-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (31 loc) · 1.03 KB
/
publish_master.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Publish master image
on:
push:
branches:
- master
schedule:
# Every Sunday, create a new version, to make sure we use an up-to-date base image
- cron: '0 0 * * 0'
jobs:
publish_image:
name: Publish master image
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Set lowercase repository name
run: echo "GITHUB_REPOSITORY_LC=$(echo ${GITHUB_REPOSITORY} | tr [A-Z] [a-z])" >> $GITHUB_ENV
- name: Build Docker image
run: |
docker build -t docker.pkg.github.com/${GITHUB_REPOSITORY_LC}/master:latest .
- name: Log in to GitHub Docker registry
run: echo "${GITHUB_TOKEN}" | docker login docker.pkg.github.com -u "${{ github.actor }}" --password-stdin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push Docker image
run: |
docker push docker.pkg.github.com/${GITHUB_REPOSITORY_LC}/master:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}