Repository navigation
58 lines (53 loc) · 1.89 KB
/
Copy pathsimplesamlphp.yml
File metadata and controls
58 lines (53 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: simplesamlphp
on:
workflow_dispatch:
push:
paths:
- ".github/workflows/simplesamlphp.yml"
- "services/simplesamlphp/**"
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4
- uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build container
id: docker_build
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7
with:
context: services/simplesamlphp
push: ${{ github.ref == 'refs/heads/main' }}
tags: ghcr.io/blindern/simplesamlphp:latest
cache-from: type=gha,scope=${{ github.workflow }}
cache-to: type=gha,mode=max,scope=${{ github.workflow }}
- name: Deploy
if: github.ref == 'refs/heads/main'
run: |
curl -sS -i -N -L -H "authorization: bearer $DEPLOYER_TOKEN" -H "content-type: application/json" -X POST "https://deployer.foreningenbs.no/deploy?stream" -d '
{
"service": "simplesamlphp",
"attributes": {
"image": "ghcr.io/blindern/simplesamlphp@${{ steps.docker_build.outputs.digest }}"
}
}' | tee /tmp/deploy-output.txt
tail -1 /tmp/deploy-output.txt | grep -q "DEPLOY OK"
env:
DEPLOYER_TOKEN: ${{ secrets.DEPLOYER_TOKEN }}
e2e-tests:
if: github.ref == 'refs/heads/main'
needs: build
permissions:
contents: read
uses: ./.github/workflows/run-e2e-tests.yml
with:
tag: "@simplesamlphp"
secrets: inherit