Build and publish #46
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: Build and publish | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
jobs: | |
publish: | |
# note: this builds/tests all versions in serial for two reasons. Firstly we | |
# want all versions to release or none of them. Secondly, we will be able | |
# publish the exact images that were built and tested. | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: "opensafely-core/setup-action@v1" | |
with: | |
install-just: true | |
- name: Build images | |
run: | | |
just build v1 | |
just build v2 | |
- name: Run tests | |
run: | | |
just test v1 | |
just test v2 | |
- name: Run linters | |
run: just check | |
- name: Log into GitHub Container Registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Push image to GitHub Container Registry | |
run: | | |
just publish v1 true | |
just publish v2 true |