diff options
| author | Fuwn <[email protected]> | 2022-06-16 05:44:51 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-06-16 05:44:51 +0000 |
| commit | 45f4ccf796bba3764476b84d5cf7ed0d6d29afb4 (patch) | |
| tree | 119304041c72a930613c7a89eb2a12d5f1660ac8 /.github | |
| parent | docs(cargo): bump version 0.1.5 -> 0.1.6 (diff) | |
| download | september-45f4ccf796bba3764476b84d5cf7ed0d6d29afb4.tar.xz september-45f4ccf796bba3764476b84d5cf7ed0d6d29afb4.zip | |
ci(docker): deploy to docker on release
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/check.yaml | 1 | ||||
| -rw-r--r-- | .github/workflows/docker.yaml | 51 |
2 files changed, 52 insertions, 0 deletions
diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 00d8c34..570487b 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -14,6 +14,7 @@ env: jobs: check: + name: Check ✅ runs-on: ubuntu-latest steps: - name: Checkout 🛒 diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml new file mode 100644 index 0000000..772a61a --- /dev/null +++ b/.github/workflows/docker.yaml @@ -0,0 +1,51 @@ +name: Docker 🐳 + +on: + workflow_dispatch: + workflow_run: + workflows: ["Check ✅"] + types: + - completed + +jobs: + docker: + name: Docker 🐳 + runs-on: ubuntu-latest + steps: + - name: Checkout 🛒 + if: startsWith(github.ref, 'refs/tags/v') + uses: actions/checkout@v3 + + - name: Login to DockerHub 🐳 + uses: docker/login-action@v2 + if: startsWith(github.ref, 'refs/tags/v') + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Docker Meta 📄 + id: meta + if: startsWith(github.ref, 'refs/tags/v') + uses: docker/metadata-action@v4 + with: + images: | + fuwn/september + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + + - name: Build and Push ⚙ + uses: docker/build-push-action@v3 + if: startsWith(github.ref, 'refs/tags/v') + with: + push: startsWith(github.ref, 'refs/tags/v') + context: . + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + - name: Deploy 🚀 + uses: distributhor/workflow-webhook@v2 + if: startsWith(github.ref, 'refs/tags/v') + env: + webhook_url: ${{ secrets.WEBHOOK_URL }} + webhook_secret: september |