generated from jacobtomlinson/python-container-action
-
Notifications
You must be signed in to change notification settings - Fork 0
26 lines (26 loc) · 816 Bytes
/
release.yml
File metadata and controls
26 lines (26 loc) · 816 Bytes
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
name: Publish Docker image
on:
release:
types: [published]
jobs:
push_to_registry:
name: Push Docker image to GitHub Packages
runs-on: ubuntu-latest
steps:
- name: Set Env
run: |
echo "BUILD_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "BUILD_SHA=${GITHUB_SHA:0:7}" >> $GITHUB_ENV
- name: Docker Login
uses: docker/login-action@v2.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push to GitHub Packages
uses: docker/build-push-action@v3
with:
tags: |
ghcr.io/${{ github.repository }}:${{ env.BUILD_TAG }}
ghcr.io/${{ github.repository }}:${{ env.BUILD_SHA }}
push: true