-
Notifications
You must be signed in to change notification settings - Fork 2
39 lines (32 loc) · 974 Bytes
/
master.yaml
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
name: Master branch push
on:
push:
branches: [ master ]
jobs:
image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: PrepareReg Names
run: |
echo IMAGE_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
echo IMAGE_TAG=$(echo ${{ github.ref }} | tr '[:upper:]' '[:lower:]' | awk '{split($0,a,"/"); print a[3]}') >> $GITHUB_ENV
- name: Set up Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: GHCR Login
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: GHCR Push
uses: docker/build-push-action@v2
with:
push: true
tags: |
ghcr.io/${{ env.IMAGE_REPOSITORY }}:${{ github.sha }}