fixed workflow
Some checks failed
Build and Push App Image / build-and-push (push) Failing after 1m13s
Some checks failed
Build and Push App Image / build-and-push (push) Failing after 1m13s
This commit is contained in:
@@ -1,52 +1,54 @@
|
|||||||
name: Build and Push App Image
|
name: Build and Push App Image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- master
|
- master
|
||||||
tags:
|
tags:
|
||||||
- "v*"
|
- "v*"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
# Example: registry.example.com/your-user/noteapp
|
# Example: registry.example.com/your-user/noteapp
|
||||||
IMAGE_NAME: ${{ secrets.REGISTRY_IMAGE }}
|
IMAGE_NAME: ${{ secrets.REGISTRY_IMAGE }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-docker
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: install nodejs
|
||||||
uses: actions/checkout@v4
|
run: apt update -y && apt install nodejs -y
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Set image tags
|
||||||
|
id: vars
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
SHORT_SHA="${GITHUB_SHA::7}"
|
||||||
|
BRANCH="${GITHUB_REF_NAME//\//-}"
|
||||||
|
|
||||||
- name: Set image tags
|
echo "short_sha=${SHORT_SHA}" >> "$GITHUB_OUTPUT"
|
||||||
id: vars
|
echo "branch=${BRANCH}" >> "$GITHUB_OUTPUT"
|
||||||
shell: bash
|
- name: Set up QEMU
|
||||||
run: |
|
uses: docker/setup-qemu-action@v2
|
||||||
SHORT_SHA="${GITHUB_SHA::7}"
|
- name: Login to Gitea Container Registry
|
||||||
BRANCH="${GITHUB_REF_NAME//\//-}"
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ secrets.REGISTRY_HOST }}
|
||||||
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
echo "short_sha=${SHORT_SHA}" >> "$GITHUB_OUTPUT"
|
- name: Build and push app image
|
||||||
echo "branch=${BRANCH}" >> "$GITHUB_OUTPUT"
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
- name: Login to Gitea Container Registry
|
context: .
|
||||||
uses: docker/login-action@v3
|
file: ./devops/docker/Dockerfile
|
||||||
with:
|
push: true
|
||||||
registry: ${{ secrets.REGISTRY_HOST }}
|
build-args: |
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
VITE_API_BASE_URL=${{ secrets.VITE_API_BASE_URL }}
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
tags: |
|
||||||
|
${{ env.IMAGE_NAME }}:latest
|
||||||
- name: Build and push app image
|
${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.short_sha }}
|
||||||
uses: docker/build-push-action@v6
|
${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.branch }}
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./devops/docker/Dockerfile
|
|
||||||
push: true
|
|
||||||
build-args: |
|
|
||||||
VITE_API_BASE_URL=${{ secrets.VITE_API_BASE_URL }}
|
|
||||||
tags: |
|
|
||||||
${{ env.IMAGE_NAME }}:latest
|
|
||||||
${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.short_sha }}
|
|
||||||
${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.branch }}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user