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