forked from sprintertech/sygma-relayer
-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (43 loc) · 1.31 KB
/
publish-tagged.yml
File metadata and controls
52 lines (43 loc) · 1.31 KB
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
44
45
46
47
48
49
50
51
52
name: Publish Tagged Docker Image
permissions:
packages: write
contents: read
on:
release:
types:
- published
env:
ORG: 'sprintertech'
REGISTRY: 'ghcr.io'
GO111MODULE: on
GOPRIVATE: github.com/sprintertech
TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout code
uses: actions/checkout@v4
- name: setup git access to private repos
run: git config --global url."https://${TOKEN}:x-oauth-basic@github.com/sprintertech/".insteadOf "https://github.com/sprintertech/"
# Log in to GHCR
- name: Log in to GHCR
id: ghcr
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build and push the Docker image
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
# Pass build arguments for the GitHub credentials
secrets: |
GH_USER_NAME=${{ secrets.GH_USER_NAME }}
GH_USER_TOKEN=${{ secrets.GHCR_TOKEN }}
tags: |
${{ env.REGISTRY }}/${{ github.repository }}:${{ github.ref_name }}