File tree 1 file changed +44
-0
lines changed
1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Create packages
2
+ on :
3
+ pull_request :
4
+ branches :
5
+ - main
6
+ types :
7
+ - closed
8
+
9
+
10
+ jobs :
11
+ main :
12
+ if : github.event.pull_request.merged == true
13
+ runs-on : ubuntu-latest
14
+ permissions :
15
+ contents : read
16
+ packages : write
17
+
18
+ steps :
19
+ - name : Checkout
20
+ uses : actions/checkout@v2
21
+
22
+ - name : Build and push images
23
+ working-directory : production
24
+ env :
25
+ DOCKER_BUILDKIT : 1
26
+ COMPOSE_DOCKER_CLI_BUILD : 1
27
+ GH_ACTOR : ${{ github.actor }}
28
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
29
+ GH_HEAD_REF : ${{ github.head_ref }}
30
+ run : |
31
+ echo "${GH_TOKEN}" | docker login ghcr.io -u "${GH_ACTOR}" --password-stdin
32
+ tag="${GH_HEAD_REF}"-test
33
+
34
+ docker pull "ghcr.io/nbisweden/urdr-web:latest" || true
35
+ docker pull "ghcr.io/nbisweden/urdr-web:$tag" || true
36
+
37
+ cat > urdr.env <<END
38
+ PUBLIC_API_URL="https://urdr-test.nbis.se"
39
+ PUBLIC_REDMINE_URL="https://urdr-test-redmine.nbis.se"
40
+ END
41
+
42
+ TAG="$tag" docker-compose --env-file urdr.env build nginx --build-arg BUILDKIT_INLINE_CACHE=1
43
+
44
+ docker push "ghcr.io/nbisweden/urdr-web:$tag"
You can’t perform that action at this time.
0 commit comments