add docker pub

This commit is contained in:
yedf2 2021-09-03 22:13:22 +08:00
parent 2550cce213
commit 00f68d9b15
3 changed files with 16 additions and 2 deletions

View File

@ -23,3 +23,12 @@ jobs:
args: release -f helper/.goreleaser.yml --rm-dist args: release -f helper/.goreleaser.yml --rm-dist
env: env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Publish docker
env:
host: 'ubuntu@en.dtm.pub'
dest: '/home/ubuntu'
run: |
echo "${{secrets.DEPLOY_KEY}}" > deploy_key
chmod 600 ./deploy_key
ssh -i deploy_key -o StrictHostKeyChecking=no ${{env.host}} 'cd ${{env.dest}}/dtm && sh helper/build-repo.sh ${{github.event.release.tag_name}}'

View File

@ -8,7 +8,6 @@ builds:
- darwin - darwin
goarch: goarch:
- amd64 - amd64
- arm64
id: 'dtm' id: 'dtm'
dir: . dir: .
main: ./app/main.go main: ./app/main.go

View File

@ -1,2 +1,8 @@
set -x set -x
if [ x$1 == x ]; then
echo please specify version
exit 1
fi
docker build -f helper/Dockerfile-release -t yedf/dtm:latest . && docker push yedf/dtm:latest docker build -f helper/Dockerfile-release -t yedf/dtm:latest . && docker push yedf/dtm:latest
docker tag yedf/dtm:latest yedf/dtm:$1 && docker push yedf/dtm:$1