You've already forked wakapi-readme-stats
feature: Add new build image
Some checks failed
Build and Publish Docker Image / build (push) Failing after 48s
Some checks failed
Build and Publish Docker Image / build (push) Failing after 48s
This commit is contained in:
51
.github/workflows/build_image.yml
vendored
51
.github/workflows/build_image.yml
vendored
@@ -1,52 +1,29 @@
|
|||||||
name: PUBLISH_IMAGE
|
name: Build and Publish Docker Image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- develop
|
- develop
|
||||||
|
workflow_dispatch:
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish-server-image:
|
build:
|
||||||
name: Publish 'wakapi-readme-stats' image
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
container:
|
|
||||||
image: catthehacker/ubuntu:act-latest
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout 🛎️
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Docker Buildx 🐋
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
- name: Log in to the container registry 🚪
|
- name: Log in to Docker registry
|
||||||
uses: docker/login-action@v2
|
run: |
|
||||||
with:
|
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login ${{ vars.DOCKER_REGISTRY }} -u ${{ vars.DOCKER_USERNAME }} --password-stdin
|
||||||
registry: ${{ vars.DOCKER_REGISTRY }}
|
|
||||||
username: ${{ vars.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Extract metadata (tags, labels) for Docker 🏋️
|
- name: Build the Docker image
|
||||||
id: meta
|
run: |
|
||||||
uses: docker/metadata-action@v4
|
docker build . -t ${{ vars.DOCKER_REGISTRY }}/${{ github.repository }}:${{ github.ref_name }}
|
||||||
with:
|
|
||||||
images: git.fran.jp.net/${{ github.repository }}
|
|
||||||
tags: |
|
|
||||||
type=ref,event=branch
|
|
||||||
type=ref,event=pr
|
|
||||||
type=semver,pattern={{version}}
|
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
|
||||||
|
|
||||||
- name: Build and push Docker image 🏗️
|
- name: Push the Docker image
|
||||||
uses: docker/build-push-action@v4
|
run: |
|
||||||
with:
|
docker push ${{ vars.DOCKER_REGISTRY }}/${{ github.repository }}:${{ github.ref_name }}
|
||||||
push: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/releases') }}
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
|
|||||||
Reference in New Issue
Block a user