Add: publish new Docker image on the GitHub Package Registry (#3)

Do this on every push to master, and every Sunday.
This commit is contained in:
Patric Stout
2019-10-30 17:26:31 +01:00
committed by GitHub
parent 66fb540388
commit 8b7f1c0192
2 changed files with 31 additions and 1 deletions
+27
View File
@@ -0,0 +1,27 @@
name: Push image
on:
push:
branches:
- master
schedule:
# Every Sunday, create a new version, to make sure we use an up-to-date base image, etc
- cron: '0 0 * * 0'
jobs:
publish_image:
name: Publish image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Build
run: |
GITHUB_REPOSITORY_LC=$(echo "${GITHUB_REPOSITORY}" | tr [A-Z] [a-z])
docker build -t docker.pkg.github.com/${GITHUB_REPOSITORY_LC}/master:latest .
- name: Publish
run: |
GITHUB_REPOSITORY_LC=$(echo "${GITHUB_REPOSITORY}" | tr [A-Z] [a-z])
docker login docker.pkg.github.com -u publisher -p "${GITHUB_TOKEN}"
docker push docker.pkg.github.com/${GITHUB_REPOSITORY_LC}/master:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+4 -1
View File
@@ -1,6 +1,9 @@
name: Testing
on: [pull_request]
on:
pull_request:
branches:
- master
jobs:
run_action: