Merge pull request #31 from element-hq/dependabot/docker/tailscale/ta… #100
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tailscale K8S Image | |
on: | |
push: | |
branches: [ main, testing ] | |
tags: ["v*.*.*"] | |
pull_request: | |
branches: [ main, testing ] | |
env: | |
REGISTRY: ghcr.io/element-hq | |
BASE_TAG: ${{ github.ref_name }} | |
IMAGE_NAME: tailscale-k8s | |
jobs: | |
build-push-image: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Log into registry ${{ env.REGISTRY }} | |
uses: docker/login-action@v1 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract Docker metadata | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
if: contains(github.ref_name, '/merge') == false | |
- name: Build and push Docker image for PR | |
uses: docker/build-push-action@v2 | |
with: | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
if: contains(github.ref_name, '/merge') |