Skip to content

Commit

Permalink
ci: fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyxdd committed Sep 6, 2023
1 parent 7fe0139 commit e177b35
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build Docker Image
name: "Build Docker Image"

on:
workflow_dispatch:
push:
tags:
- app/v*.*.*
Expand All @@ -14,10 +15,12 @@ jobs:
steps:
- name: Check out
uses: actions/checkout@v3
with:
fetch-depth: 0 # fetch all tags

- name: Get tag
id: get_tag
run: echo "TAG=$(git describe --tags --always --match 'app/v*' | sed -n 's|app/\([^/-]*\)\(-.*\)\{0,1\}|\1|p')" >> $GITHUB_OUTPUT
- name: Get version
id: get_version
run: echo "version=$(git describe --tags --always --match 'app/v*' | sed -n 's|app/\([^/-]*\)\(-.*\)\{0,1\}|\1|p')" >> $GITHUB_OUTPUT

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand All @@ -26,19 +29,19 @@ jobs:
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v2.1.0
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v4.0.0
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: tobyxdd/hysteria:latest,tobyxdd/hysteria:v2,tobyxdd/hysteria:${{ steps.get_tag.outputs.TAG }}
tags: tobyxdd/hysteria:latest,tobyxdd/hysteria:v2,tobyxdd/hysteria:${{ steps.get_version.outputs.version }}

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
2 changes: 2 additions & 0 deletions .github/workflows/scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- master
paths:
- scripts/**

jobs:
publish:
Expand Down

0 comments on commit e177b35

Please sign in to comment.