Build and push a docker image to the GH registry

For every push to master
This commit is contained in:
Christoph Reiter
2021-03-29 20:43:13 +02:00
parent 10c4e00641
commit b9d950e0af

View File

@@ -3,7 +3,7 @@ name: test
on: [push, pull_request]
jobs:
build:
test:
runs-on: ubuntu-latest
strategy:
matrix:
@@ -26,3 +26,22 @@ jobs:
- name: Test
run: |
poetry run pytest
deploy:
needs: [test]
runs-on: ubuntu-latest
if: (github.repository == 'msys2/msys2-web' && github.event_name == 'push' && github.ref == 'refs/heads/master')
steps:
- uses: actions/checkout@v2
- name: Log in
run: |
echo "$TOKEN" | docker login ghcr.io --username "$USERNAME" --password-stdin
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
USERNAME: ${{ github.actor }}
- name: Build image
run: |
docker build --tag ghcr.io/msys2/msys2-web:latest .
- name: Deploy image
run: |
docker push ghcr.io/msys2/msys2-web:latest