fix workflow

This commit is contained in:
mii443
2024-08-31 21:56:33 +09:00
parent ce887e4815
commit 8684435276

View File

@@ -1,30 +1,46 @@
name: Docker Build and Push
on: on:
push: release:
branches-ignore: types: [created]
- '**'
tags: env:
- 'v*' REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs: jobs:
build: build-and-push:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps: steps:
- name: Check out the repository - name: Checkout repository
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry - name: Log in to the Container registry
uses: docker/login-action@v3 uses: docker/login-action@v2
with: with:
registry: ghcr.io registry: ${{ env.REGISTRY }}
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v2 - name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with: with:
context: . context: .
push: true push: true
tags: | tags: ${{ steps.meta.outputs.tags }}
ghcr.io/mii443/rs-easy-p2p/signaling-server:{{version}} labels: ${{ steps.meta.outputs.labels }}
ghcr.io/mii443/rs-easy-p2p/signaling-server:latest cache-from: type=gha
cache-to: type=gha,mode=max