Skip to content

Commit

Permalink
Merge pull request #558 from NBISweden/dev/test-action
Browse files Browse the repository at this point in the history
Add action for urdr-web test image
  • Loading branch information
jonandernovella authored Aug 10, 2022
2 parents 502d6ae + a08b1b5 commit ef6a369
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/create-test-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Create packages
on:
pull_request:
branches:
- main
types:
- closed


jobs:
main:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Build and push images
working-directory: production
env:
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
GH_ACTOR: ${{ github.actor }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_HEAD_REF: ${{ github.head_ref }}
run: |
echo "${GH_TOKEN}" | docker login ghcr.io -u "${GH_ACTOR}" --password-stdin
tag="${GH_HEAD_REF}"-test
docker pull "ghcr.io/nbisweden/urdr-web:latest" || true
docker pull "ghcr.io/nbisweden/urdr-web:$tag" || true
cat > urdr.env <<END
PUBLIC_API_URL="https://urdr-test.nbis.se"
PUBLIC_REDMINE_URL="https://urdr-test-redmine.nbis.se"
END
TAG="$tag" docker-compose --env-file urdr.env build nginx --build-arg BUILDKIT_INLINE_CACHE=1
docker push "ghcr.io/nbisweden/urdr-web:$tag"

0 comments on commit ef6a369

Please sign in to comment.