mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2024-11-22 07:10:09 +01:00
Update main.yml
This commit is contained in:
parent
56287d8e7a
commit
fee6cf29eb
35
.github/workflows/main.yml
vendored
35
.github/workflows/main.yml
vendored
@ -9,6 +9,11 @@ on:
|
|||||||
description: 'Trigger a manual build and push'
|
description: 'Trigger a manual build and push'
|
||||||
default: 'true'
|
default: 'true'
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: docker.io
|
||||||
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
|
SHA: ${{ github.event.pull_request.head.sha || github.event.after }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-analyze:
|
build-and-analyze:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -23,15 +28,33 @@ jobs:
|
|||||||
- name: Log in to Docker Hub
|
- name: Log in to Docker Hub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Extract Docker metadata
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v4.4.0
|
||||||
|
with:
|
||||||
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
|
labels: |
|
||||||
|
org.opencontainers.image.revision=${{ env.SHA }}
|
||||||
|
tags: |
|
||||||
|
type=edge,branch=$repo.default_branch
|
||||||
|
type=semver,pattern=v{{version}}
|
||||||
|
type=sha,prefix=,suffix=,format=short
|
||||||
|
|
||||||
- name: Build multiarch Docker image
|
- name: Build and push Docker image
|
||||||
id: build-image
|
id: build-and-push
|
||||||
run: |
|
uses: docker/build-push-action@v4.0.0
|
||||||
docker buildx create --use
|
with:
|
||||||
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t wg-dashboard:latest .
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
- name: Docker Scout Analysis
|
- name: Docker Scout Analysis
|
||||||
id: docker-scout
|
id: docker-scout
|
||||||
run: |
|
run: |
|
||||||
|
Loading…
Reference in New Issue
Block a user