Skip to content

Commit

Permalink
Add docker build to CI script
Browse files Browse the repository at this point in the history
  • Loading branch information
kaenganxt committed Oct 27, 2023
1 parent ebb0438 commit 10184eb
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,38 @@ jobs:
- run: nix develop --impure -c ./test-setup.sh /tmp
- run: nix develop --impure -c pytest

docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set lower case owner name
run: |
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
env:
OWNER: '${{ github.repository_owner }}'
- name: set tag to latest
run: |
sed -i 's/ contents/ tag = "latest";\n contents/' nix/docker.nix nix/docker_static.nix
- name: Build docker image
run: nix develop --impure -c build_docker
- name: Load app image
run: docker load -i docker-image-ekklesia-portal.tar
if: github.ref == 'refs/heads/piraten-bund'
- name: Load static image
run: docker load -i docker-image-ekklesia-portal-static.tar
if: github.ref == 'refs/heads/piraten-bund'
- name: Login to docker registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
if: github.ref == 'refs/heads/piraten-bund'
- name: Push docker image
run: docker push ghcr.io/${{ env.OWNER_LC }}/ekklesia-portal:latest
if: github.ref == 'refs/heads/piraten-bund'
- name: Push docker static image
run: docker push ghcr.io/${{ env.OWNER_LC }}/ekklesia-portal-static:latest
if: github.ref == 'refs/heads/piraten-bund'
- uses: actions/upload-artifact@v3
with:
name: Ekklesia Docker Images
path: docker-image-*.tar

# vim: set filetype=yaml sw=2 ts=2 sts=2 expandtab:

0 comments on commit 10184eb

Please sign in to comment.