mirror of https://github.com/go-gost/gost.git
update github actions
parent
94cd590142
commit
404e099907
|
|
@ -46,48 +46,27 @@ jobs:
|
|||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: latest
|
||||
|
||||
- name: Environment
|
||||
run: |
|
||||
echo home=$HOME
|
||||
echo git_ref=$GITHUB_REF
|
||||
echo git_sha=$GITHUB_SHA
|
||||
echo version=${{ steps.prepare.outputs.version }}
|
||||
echo image=${{ steps.prepare.outputs.docker_image }}
|
||||
echo tags=${{ steps.prepare.outputs.tags }}
|
||||
echo platforms=${{ steps.prepare.outputs.docker_platforms }}
|
||||
echo avail_platforms=${{ steps.buildx.outputs.platforms }}
|
||||
|
||||
# https://github.com/actions/checkout
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Login to DockerHub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Docker Buildx (no push)
|
||||
run: |
|
||||
docker buildx bake \
|
||||
--set ${{ github.event.repository.name }}.platform=${{ steps.prepare.outputs.docker_platforms }} \
|
||||
--set ${{ github.event.repository.name }}.output=type=image,push=false \
|
||||
--set ${{ github.event.repository.name }}.tags="${{ steps.prepare.outputs.tags }}" \
|
||||
--file docker-compose.yaml
|
||||
|
||||
- name: Docker Login
|
||||
if: success()
|
||||
env:
|
||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||
run: |
|
||||
echo "${DOCKER_PASSWORD}" | docker login --username "${{ secrets.DOCKER_USERNAME }}" --password-stdin
|
||||
|
||||
- name: Docker Buildx (push)
|
||||
if: success()
|
||||
run: |
|
||||
docker buildx bake \
|
||||
--set ${{ github.event.repository.name }}.platform=${{ steps.prepare.outputs.docker_platforms }} \
|
||||
--set ${{ github.event.repository.name }}.output=type=image,push=true \
|
||||
--set ${{ github.event.repository.name }}.tags="${{ steps.prepare.outputs.tags }}" \
|
||||
--file docker-compose.yaml
|
||||
|
||||
- name: Clear
|
||||
if: always()
|
||||
run: |
|
||||
rm -f ${HOME}/.docker/config.json
|
||||
- name: Buildx and push
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
platforms: ${{ steps.prepare.outputs.docker_platforms }}
|
||||
push: true
|
||||
tags: ${{ steps.prepare.outputs.tags }}
|
||||
12
Dockerfile
12
Dockerfile
|
|
@ -1,10 +1,4 @@
|
|||
FROM --platform=$BUILDPLATFORM golang:1.22-alpine as builder
|
||||
|
||||
# Convert TARGETPLATFORM to GOARCH format
|
||||
# https://github.com/tonistiigi/xx
|
||||
COPY --from=tonistiigi/xx:golang / /
|
||||
|
||||
ARG TARGETPLATFORM
|
||||
FROM --platform=$BUILDPLATFORM golang:1.23-alpine3.20 AS builder
|
||||
|
||||
RUN apk add --no-cache musl-dev git gcc
|
||||
|
||||
|
|
@ -12,11 +6,9 @@ ADD . /src
|
|||
|
||||
WORKDIR /src
|
||||
|
||||
ENV GO111MODULE=on
|
||||
|
||||
RUN cd cmd/gost && go env && go build
|
||||
|
||||
FROM alpine:latest
|
||||
FROM alpine:3.20
|
||||
|
||||
# add iptables for tun/tap
|
||||
RUN apk add --no-cache iptables
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
version: "3.4"
|
||||
services:
|
||||
gost:
|
||||
build: .
|
||||
Loading…
Reference in New Issue