mirror of
https://github.com/sorenisanerd/gotty.git
synced 2024-11-24 21:04:24 +00:00
Add gitlab action steps to build and push docker
This commit is contained in:
parent
b63ea16697
commit
3913c1c91e
19
.github/workflows/pre-release.yaml
vendored
19
.github/workflows/pre-release.yaml
vendored
@ -22,7 +22,6 @@ jobs:
|
||||
with:
|
||||
go-version: 1.16
|
||||
|
||||
|
||||
- name: "Build & test"
|
||||
run: "make tools release-artifacts"
|
||||
|
||||
@ -35,3 +34,21 @@ jobs:
|
||||
files: |
|
||||
LICENSE
|
||||
builds/dist/*
|
||||
|
||||
- uses: docker/setup-qemu-action@v1
|
||||
|
||||
- uses: docker/setup-buildx-action@v1
|
||||
|
||||
- uses: docker/login-action@v1
|
||||
with:
|
||||
username: "${{ secrets.DOCKER_HUB_USER }}"
|
||||
password: "${{ secrets.DOCKER_HUB_TOKEN }}"
|
||||
|
||||
- name: "Build and push docker image"
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||
push: true
|
||||
tags: "${{ secrets.DOCKER_REPO }}:latest"
|
15
Dockerfile
15
Dockerfile
@ -1,15 +1,20 @@
|
||||
FROM golang:1.16
|
||||
FROM node:16 as js-build
|
||||
WORKDIR /gotty
|
||||
COPY js /gotty/js
|
||||
COPY Makefile /gotty/
|
||||
RUN make bindata/static/js/gotty.js.map
|
||||
|
||||
FROM golang:1.16 as go-build
|
||||
WORKDIR /gotty
|
||||
COPY . /gotty
|
||||
COPY --from=js-build /gotty/js/node_modules /gotty/js/node_modules
|
||||
COPY --from=js-build /gotty/bindata/static/js /gotty/bindata/static/js
|
||||
RUN CGO_ENABLED=0 make
|
||||
|
||||
FROM alpine:latest
|
||||
|
||||
RUN apk update && \
|
||||
apk upgrade && \
|
||||
apk --no-cache add ca-certificates && \
|
||||
apk add bash
|
||||
apk --no-cache add ca-certificates bash
|
||||
WORKDIR /root
|
||||
COPY --from=0 /gotty/gotty /usr/bin/
|
||||
COPY --from=go-build /gotty/gotty /usr/bin/
|
||||
CMD ["gotty", "-w", "bash"]
|
||||
|
Loading…
Reference in New Issue
Block a user