-
Notifications
You must be signed in to change notification settings - Fork 3
35 lines (31 loc) · 975 Bytes
/
Copy pathrelease.yml
File metadata and controls
35 lines (31 loc) · 975 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
27
28
29
30
31
32
33
34
35
name: release
on:
release:
types: [created]
permissions:
contents: read
packages: write # required to push the image to GHCR
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }} # ghcr.io/target/pull-request-code-coverage
jobs:
docker:
environment: deployment
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} # built-in token, no extra secrets needed
- name: Docker Build and Push
id: docker_build
uses: docker/build-push-action@v6
with:
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.release.tag_name }}