Skip to content

git workflow 변경 #69

git workflow 변경

git workflow 변경 #69

Workflow file for this run

name: build-and-push-arm64

Check failure on line 1 in .github/workflows/cicd.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/cicd.yml

Invalid workflow file

(Line: 24, Col: 13): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.REGISTRY_USERNAME != '' && secrets.REGISTRY_PASSWORD != ''
on:
push:
branches: [ "main" ]
workflow_dispatch:
env:
IMAGE_NAME: algorithm-blog
REGISTRY_HOST: ${{ secrets.REGISTRY_HOST }}
jobs:
build-and-push:
runs-on: ["self-hosted", "linux", "arm64"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to registry (optional)
if: ${{ secrets.REGISTRY_USERNAME != '' && secrets.REGISTRY_PASSWORD != '' }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY_HOST }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push (arm64)
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/arm64
push: true
tags: |
${{ env.REGISTRY_HOST }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
${{ env.REGISTRY_HOST }}/${{ env.IMAGE_NAME }}:latest