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:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
publish-server-image:
|
||||
name: Publish 'wakapi-readme-stats' image
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
container:
|
||||
image: catthehacker/ubuntu:act-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout 🛎️
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx 🐋
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Log in to the container registry 🚪
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ${{ vars.DOCKER_REGISTRY }}
|
||||
username: ${{ vars.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
- name: Log in to Docker registry
|
||||
run: |
|
||||
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login ${{ vars.DOCKER_REGISTRY }} -u ${{ vars.DOCKER_USERNAME }} --password-stdin
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker 🏋️
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
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 the Docker image
|
||||
run: |
|
||||
docker build . -t ${{ vars.DOCKER_REGISTRY }}/${{ github.repository }}:${{ github.ref_name }}
|
||||
|
||||
- name: Build and push Docker image 🏗️
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
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
|
||||
- name: Push the Docker image
|
||||
run: |
|
||||
docker push ${{ vars.DOCKER_REGISTRY }}/${{ github.repository }}:${{ github.ref_name }}
|
||||
|
||||
Reference in New Issue
Block a user