-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
github actions standardization and PR testing (#16)
This is some basic standardization between workflows and PRs testing. * YAML language server for your editor * Add 2204 for all workflows * Use tagged actions so renovate can give useful changelog info * Move the renovate tailscale line comment to the correct location * Publish a form of date tag along with latest * Use tagged images so renovate can act on them in the `FROM` on the Dockerfile * Build container on PRs * Use metadata action so standard OCI labels are set
- Loading branch information
Showing
6 changed files
with
45 additions
and
20 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
--- | ||
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | ||
name: "Container: Image Build" | ||
on: | ||
workflow_dispatch: {} | ||
pull_request: | ||
branches: ["main"] | ||
types: ["opened", "synchronize", "reopened"] | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "Docker/**/*" | ||
|
||
env: | ||
# renovate: depName=tailscale.com datasource=go | ||
UPSTREAM_TS_VERSION: v1.68.0 | ||
|
||
jobs: | ||
|
@@ -16,31 +22,50 @@ jobs: | |
permissions: | ||
contents: write | ||
packages: write | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: ghcr.io/${{ github.repository }} | ||
labels: | | ||
org.opencontainers.image.source="https://github.com/tailscale/tailscale" | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=schedule | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
type=raw,value=${{ env.UPSTREAM_TS_VERSION }} | ||
- name: Set up QEMU | ||
uses: docker/[email protected] | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb | ||
uses: docker/setup-buildx-action@v3.3.0 | ||
|
||
- name: Log into registry ghcr.io | ||
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 | ||
uses: docker/login-action@v3.2.0 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
id: build-and-push | ||
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 | ||
uses: docker/build-push-action@v6.2.0 | ||
with: | ||
push: true | ||
push: ${{ github.event_name != 'pull_request' }} | ||
context: ./ | ||
file: ./Docker/Dockerfile | ||
labels: ${{ steps.meta.outputs.labels }} | ||
platforms: linux/amd64,linux/arm64 | ||
build-args: | | ||
# renovate: depName=tailscale.com datasource=go | ||
VERSION=${{ env.UPSTREAM_TS_VERSION }} | ||
tags: | | ||
ghcr.io/${{ github.repository }}:${{ env.UPSTREAM_TS_VERSION }} | ||
tags: ${{ steps.meta.outputs.tags }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
--- | ||
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | ||
name: "Release" | ||
|
||
on: | ||
|
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
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