-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (36 loc) · 988 Bytes
/
release.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
38
39
40
41
42
43
name: Build and Publish Docker
on:
pull_request:
workflow_dispatch:
push:
branches:
- main
env:
REGISTRY: ghcr.io
OWNER_NAME: deploygate
IMAGE_NAME: deploygate-mock-server
jobs:
build_and_push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.OWNER_NAME }}
password: ${{ github.token }}
- id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.OWNER_NAME }}/${{ env.IMAGE_NAME }}
- uses: docker/build-push-action@v5.2.0
with:
context: .
target: ghcr
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}