Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0c2b7ae461 | |||
| bb4d1439cf | |||
| d8b07d11a1 | |||
| 3e75a5b445 | |||
| 46177264a1 | |||
| ec9e6ca83c |
35
.github/workflows/build.yml
vendored
Normal file
35
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
name: Build
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags: '*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
prepare-data:
|
||||||
|
name: Prepare Data
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
tag: ${{ steps.prepare.outputs.SOURCE_TAG }}
|
||||||
|
steps:
|
||||||
|
- id: prepare
|
||||||
|
name: Prepare environment variables
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
run: |
|
||||||
|
echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/}
|
||||||
|
echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/}
|
||||||
|
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
|
||||||
|
|
||||||
|
build:
|
||||||
|
name: GitHub Package Registry
|
||||||
|
id: ghpr
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [prepare-data]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Login to GitHub Package Registry
|
||||||
|
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login https://docker.pkg.github.com -u luketainton --password-stdin
|
||||||
|
- name: Build image for GitHub Package Registry
|
||||||
|
run: docker build . --file Dockerfile --tag docker.pkg.github.com/luketainton/ipilot/ipilot:${{ needs.prepare-data.outputs.tag }} --tag docker.pkg.github.com/luketainton/ipilot/ipilot:latest
|
||||||
|
- name: Push image to GitHub Package Registry
|
||||||
|
run: |
|
||||||
|
docker push docker.pkg.github.com/luketainton/ipilot/ipilot:latest
|
||||||
|
docker push docker.pkg.github.com/luketainton/ipilot/ipilot:${{ needs.prepare-data.outputs.tag }}
|
||||||
9
Dockerfile
Normal file
9
Dockerfile
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
FROM golang:1.16-alpine as build
|
||||||
|
WORKDIR /go/src/app
|
||||||
|
COPY . /go/src/app
|
||||||
|
RUN CGO_ENABLED=0 go build -o /go/bin/app
|
||||||
|
|
||||||
|
FROM gcr.io/distroless/base-debian10
|
||||||
|
LABEL maintainer="Luke Tainton <luke@tainton.uk>"
|
||||||
|
COPY --from=build /go/bin/app /
|
||||||
|
CMD ["/app"]
|
||||||
Reference in New Issue
Block a user