forked from Mouws/protonmail-bridge-nextcoud-podman
Use Docker Hub build
This commit is contained in:
parent
96351a72c0
commit
3f75d01226
18
.github/workflows/main.yaml
vendored
18
.github/workflows/main.yaml
vendored
@ -3,9 +3,9 @@ name: build
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- 'v*'
|
||||||
repository_dispatch:
|
repository_dispatch:
|
||||||
types: update
|
types: build
|
||||||
|
|
||||||
env:
|
env:
|
||||||
DOCKER_TAG: shenxn/protonmail-bridge
|
DOCKER_TAG: shenxn/protonmail-bridge
|
||||||
@ -44,13 +44,7 @@ jobs:
|
|||||||
asset_path: ./deb/${{ env.DEB_FILE }}
|
asset_path: ./deb/${{ env.DEB_FILE }}
|
||||||
asset_name: ${{ env.DEB_FILE }}
|
asset_name: ${{ env.DEB_FILE }}
|
||||||
asset_content_type: application/vnd.debian.binary-package
|
asset_content_type: application/vnd.debian.binary-package
|
||||||
- name: Docker Login
|
- name: Push Tag to Trigger Docker Hub Build
|
||||||
uses: azure/docker-login@v1
|
env:
|
||||||
with:
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
run: bash push-tag.sh
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
||||||
- name: Docker Build
|
|
||||||
run: |
|
|
||||||
docker build . -t ${DOCKER_TAG}:latest -t ${DOCKER_TAG}:${RELEASE}
|
|
||||||
docker push ${DOCKER_TAG}:latest
|
|
||||||
docker push ${DOCKER_TAG}:${RELEASE}
|
|
||||||
|
|||||||
@ -19,7 +19,7 @@ if [[ RELEASE != CURR_RELEASE ]]; then
|
|||||||
git config --local user.name "Github Action"
|
git config --local user.name "Github Action"
|
||||||
git add releaserc
|
git add releaserc
|
||||||
git commit -m "Release ${CURR_RELEASE}" --author="Xiaonan Shen <s@sxn.dev>"
|
git commit -m "Release ${CURR_RELEASE}" --author="Xiaonan Shen <s@sxn.dev>"
|
||||||
git tag -a ${CURR_RELEASE} -m "Release ${CURR_RELEASE}"
|
git tag -a "v${CURR_RELEASE}" -m "Release ${CURR_RELEASE}"
|
||||||
|
|
||||||
# push
|
# push
|
||||||
REMOTE_REPO="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
|
REMOTE_REPO="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
|
||||||
@ -30,6 +30,6 @@ if [[ RELEASE != CURR_RELEASE ]]; then
|
|||||||
curl -H "Accept: application/vnd.github.everest-preview+json" \
|
curl -H "Accept: application/vnd.github.everest-preview+json" \
|
||||||
-H "Authorization: token ${PERSONAL_TOKEN}" \
|
-H "Authorization: token ${PERSONAL_TOKEN}" \
|
||||||
--request POST \
|
--request POST \
|
||||||
--data '{"event_type": "update"}' \
|
--data '{"event_type": "build"}' \
|
||||||
https://api.github.com/repos/${GITHUB_REPOSITORY}/dispatches
|
https://api.github.com/repos/${GITHUB_REPOSITORY}/dispatches
|
||||||
fi
|
fi
|
||||||
|
|||||||
11
push-tag.sh
Normal file
11
push-tag.sh
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
source ./releaserc
|
||||||
|
|
||||||
|
git config --local user.email "actions@github.com"
|
||||||
|
git config --local user.name "Github Action"
|
||||||
|
git tag -a "r${RELEASE}" -m "Release ${RELEASE}"
|
||||||
|
REMOTE_REPO="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
|
||||||
|
git push "${REMOTE_REPO}" "r${RELEASE}"
|
||||||
Loading…
Reference in New Issue
Block a user