GH-1: Push Docker image to repository #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: pip install .[dev] | |
- name: Install browsers | |
run: playwright install --with-deps chromium | |
- name: Run type check | |
run: mypy schemes | |
- name: Run tests | |
run: pytest | |
- id: auth | |
name: Authenticate with Google Cloud | |
uses: google-github-actions/auth@v1 | |
with: | |
token_format: access_token | |
credentials_json: '${{ secrets.GCP_CREDENTIALS }}' | |
- name: Login to Docker repository | |
uses: docker/login-action@v1 | |
with: | |
registry: europe-west1-docker.pkg.dev | |
username: oauth2accesstoken | |
password: ${{ steps.auth.outputs.access_token }} | |
- name: Build and push image | |
uses: docker/build-push-action@v4 | |
with: | |
tags: europe-west1-docker.pkg.dev/dft-ate-schemes-prt/docker/schemes | |
push: true |