-
Notifications
You must be signed in to change notification settings - Fork 3
36 lines (34 loc) · 1.1 KB
/
build-push-go.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
name: build-push-go
on: push
jobs:
build-push-go:
runs-on: ubuntu-latest
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
ARCH: "amd64"
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}-go
DOCKER_IMAGE_TAG: ${{ github.sha }}
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Docker Login
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up pack
uses: buildpacks/github-actions/setup-pack@v5.0.0
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: build
run: |
pack build ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.DOCKER_IMAGE_TAG }} \
--path ./go \
--builder paketobuildpacks/builder-jammy-buildpackless-static \
--buildpack paketo-buildpacks/go \
--tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest \
--publish