mirror of
https://github.com/shenxn/protonmail-bridge-docker.git
synced 2025-12-06 08:27:08 +00:00
Migrate to build-push-action@v2 (#10)
This commit is contained in:
commit
539fa59e63
32
.github/workflows/main.yaml
vendored
32
.github/workflows/main.yaml
vendored
@ -12,11 +12,12 @@ on:
|
|||||||
- entrypoint.sh
|
- entrypoint.sh
|
||||||
- gpgparams
|
- gpgparams
|
||||||
- install.sh
|
- install.sh
|
||||||
- set-env.sh
|
|
||||||
- VERSION
|
- VERSION
|
||||||
|
pull_request:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
DOCKER_REPO: shenxn/protonmail-bridge
|
DOCKER_REPO: shenxn/protonmail-bridge
|
||||||
|
DOCKER_REPO_DEV: shenxn/protonmail-bridge-dev
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -24,12 +25,29 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@master
|
||||||
- name: Set Env
|
- name: Set version
|
||||||
run: bash set-env.sh
|
id: version
|
||||||
- uses: docker/build-push-action@v1
|
run: echo "::set-output name=version::`cat VERSION`"
|
||||||
|
- name: Set repo
|
||||||
|
id: repo
|
||||||
|
run: if [[ $GITHUB_REF == "refs/heads/master" ]]; then echo "::set-output name=repo::${DOCKER_REPO}"; else echo "::set-output name=repo::${DOCKER_REPO_DEV}"; fi
|
||||||
|
- name: Docker meta
|
||||||
|
id: docker_meta
|
||||||
|
uses: crazy-max/ghaction-docker-meta@v1
|
||||||
|
with:
|
||||||
|
images: ${{ steps.repo.outputs.repo }}
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
- name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
repository: shenxn/protonmail-bridge
|
- uses: docker/build-push-action@v2
|
||||||
tags: ${{ env.TAGS }}
|
with:
|
||||||
add_git_labels: true
|
tags: |
|
||||||
|
${{ steps.repo.outputs.repo }}:latest
|
||||||
|
${{ steps.repo.outputs.repo }}:${{ steps.version.outputs.version }}
|
||||||
|
labels: ${{ steps.docker_meta.outputs.labels }}
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
|||||||
11
set-env.sh
11
set-env.sh
@ -1,11 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
VERSION=`cat VERSION`
|
|
||||||
|
|
||||||
if [[ $GITHUB_REF == "refs/heads/master" ]]; then
|
|
||||||
echo "TAGS=latest,${VERSION}" >> $GITHUB_ENV
|
|
||||||
else
|
|
||||||
echo "TAGS=dev,${VERSION}-dev" >> $GITHUB_ENV
|
|
||||||
fi
|
|
||||||
Loading…
Reference in New Issue
Block a user