diff options
| author | 2021-12-30 10:16:41 +0100 | |
|---|---|---|
| committer | 2022-01-09 13:00:48 +0100 | |
| commit | 46af86f8ace136dd1d1d94590d3423e6b12e3f7b (patch) | |
| tree | f190663cd8202c7bc7034adbf9dabd7da293082c /.github/workflows | |
| download | server-46af86f8ace136dd1d1d94590d3423e6b12e3f7b.tar.gz server-46af86f8ace136dd1d1d94590d3423e6b12e3f7b.tar.bz2 server-46af86f8ace136dd1d1d94590d3423e6b12e3f7b.zip | |
Prepare for githubv1.0.0
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/docker-image.yml | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..8945bfb --- /dev/null +++ b/.github/workflows/docker-image.yml | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | name: Release | ||
| 2 | |||
| 3 | on: | ||
| 4 | push: | ||
| 5 | tags: | ||
| 6 | - 'v*' | ||
| 7 | pull_request: | ||
| 8 | branches: | ||
| 9 | - 'main' | ||
| 10 | |||
| 11 | jobs: | ||
| 12 | docker: | ||
| 13 | runs-on: ubuntu-latest | ||
| 14 | steps: | ||
| 15 | - name: Checkout | ||
| 16 | uses: actions/checkout@v2 | ||
| 17 | - name: Docker meta | ||
| 18 | id: meta | ||
| 19 | uses: docker/metadata-action@v3 | ||
| 20 | with: | ||
| 21 | images: ghcr.io/tomvanderlee/ttun-server | ||
| 22 | tags: | | ||
| 23 | type=semver,pattern={{major}} | ||
| 24 | type=semver,pattern={{major}}.{{minor}} | ||
| 25 | |||
| 26 | - name: Login to DockerHub | ||
| 27 | if: github.event_name != 'pull_request' | ||
| 28 | uses: docker/login-action@v1 | ||
| 29 | with: | ||
| 30 | registry: ghcr.io | ||
| 31 | username: ${{ github.actor }} | ||
| 32 | password: ${{ secrets.GITHUB_TOKEN }} | ||
| 33 | - name: Build and push | ||
| 34 | uses: docker/build-push-action@v2 | ||
| 35 | with: | ||
| 36 | context: . | ||
| 37 | push: ${{ github.event_name != 'pull_request' }} | ||
| 38 | tags: ${{ steps.meta.outputs.tags }} | ||
| 39 | labels: ${{ steps.meta.outputs.labels }} | ||
