-
Notifications
You must be signed in to change notification settings - Fork 3
37 lines (32 loc) · 1.07 KB
/
build.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
name: Build
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version: stable
- name: Build snapshot
run: curl -sfL https://goreleaser.com/static/run | bash -s -- release --snapshot --clean
env:
VERSION: v1.18.2
- name: Push snapshot image
if: ${{ github.event_name == 'push' }}
run: |
TAG=git-$(git rev-parse --short HEAD)
docker login ghcr.io -u "$DOCKER_USER" -p "$GITHUB_TOKEN"
docker tag "ghcr.io/oursky/pageship:latest" "ghcr.io/oursky/pageship:$TAG"
docker tag "ghcr.io/oursky/pageship-controller:latest" "ghcr.io/oursky/pageship-controller:$TAG"
docker push "ghcr.io/oursky/pageship:$TAG"
docker push "ghcr.io/oursky/pageship-controller:$TAG"
env:
DOCKER_USER: ${{ github.repository_owner }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}