Publish docker images #88
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: Publish docker images | |
on: | |
schedule: | |
# Weekly, at 03:00 on Monday UTC time | |
- cron: "0 3 * * 1" | |
push: | |
branches: | |
- main | |
jobs: | |
build-test-publish: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
image: ['python-test-environment', 'smee-proxy', 'jenkins-inbound-agent', 'node-chrome'] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10' | |
- name: Install poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
version: latest | |
- name: Install dependencies | |
run: poetry install | |
- name: Build docker image | |
run: docker build -t ${{ matrix.image }}:latest ${{ matrix.image }}/. | |
- name: Test docker image | |
run: make test dir=${{ matrix.image }} | |
- name: Publish docker image to github packages | |
run: | | |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
docker tag ${{ matrix.image }}:latest ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}:latest | |
docker push ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}:latest |