mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-10-28 19:53:46 +00:00
Merge pull request #2759 from morlay/master
bump workflow actions to docker official provided
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
+32
-25
@@ -14,32 +14,39 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: crazy-max/ghaction-docker-buildx@v3
|
||||
with:
|
||||
buildx-version: v0.4.1
|
||||
submodules: true
|
||||
|
||||
- name: update submodules
|
||||
run: git submodule update --init
|
||||
- uses: docker/setup-qemu-action@v1
|
||||
- uses: docker/setup-buildx-action@v1
|
||||
- uses: docker/login-action@v1
|
||||
with:
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
|
||||
- name: login docker
|
||||
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
|
||||
|
||||
- name: build edge image
|
||||
if: github.ref == 'refs/heads/master'
|
||||
- name: check and set image version
|
||||
id: prepare
|
||||
run: |
|
||||
docker buildx build \
|
||||
--push \
|
||||
--platform=linux/arm64,linux/amd64 \
|
||||
-f=docker/alpine/Dockerfile \
|
||||
-t=${{ github.repository }}:edge \
|
||||
.
|
||||
- name: build version image
|
||||
if: github.ref != 'refs/heads/master'
|
||||
run: |
|
||||
docker buildx build \
|
||||
--push \
|
||||
--platform=linux/arm64,linux/amd64 \
|
||||
-f=docker/alpine/Dockerfile \
|
||||
-t=${{ github.repository }}:$(echo ${{ github.ref }} | sed -E 's|refs/tags/||') \
|
||||
.
|
||||
case ${{ github.ref }} in
|
||||
refs/heads/master)
|
||||
echo ::set-output name=version::edge
|
||||
echo ::set-output name=push::true
|
||||
;;
|
||||
refs/tags/*)
|
||||
echo ::set-output name=version::$(echo ${{ github.ref }} | sed -E 's|refs/tags/||')
|
||||
echo ::set-output name=push::true
|
||||
;;
|
||||
*)
|
||||
echo ::set-output name=version::${{ github.sha }}
|
||||
echo ::set-output name=push::false
|
||||
;;
|
||||
esac;
|
||||
|
||||
- name: build & push image
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: docker/alpine/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: ${{ steps.prepare.outputs.push }}
|
||||
tags: ${{ github.repository }}:${{ steps.prepare.outputs.version }}
|
||||
Reference in New Issue
Block a user