Skip to content

Commit ef6a369

Browse files
Merge pull request #558 from NBISweden/dev/test-action
Add action for urdr-web test image
2 parents 502d6ae + a08b1b5 commit ef6a369

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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"

0 commit comments

Comments
 (0)