Skip to content

修改配置

修改配置 #20

name: Docker
on:
push:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
# To compare changes between the current commit and the last pushed remote commit set `since_last_remote_commit: true`. e.g
with:
# since_last_remote_commit: true
# files: **
files_ignore: .github/**
- name: List all changed files
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
REPOSITOY: ${{variables.REPOSITOY}}

Check failure on line 34 in .github/workflows/docker-publish.yml

View workflow run for this annotation

GitHub Actions / Docker

Invalid workflow file

The workflow is not valid. .github/workflows/docker-publish.yml (Line: 34, Col: 22): Unrecognized named-value: 'variables'. Located at position 1 within expression: variables.REPOSITOY
USERNAME: ${{secrets.USERNAME}}
PASSWORD: ${{secrets.PASSWORD}}
run: |
docker login -u ${USERNAME} -p ${PASSWORD}
for file in ${ALL_CHANGED_FILES}; do
CHANGEFOLDER=$(echo ${file}|awk -F"/" '{print $1}')
cd ${CHANGEFOLDER}
VERSION=$(grep -w VERSION Dockerfile |awk -F":" '{print $2}')
echo ${VERSION}
IMAGENAME=$(echo ${REPOSITORY}/${CHANGEFOLDER}:${VERSION})
echo ${IMAGENAME}
docker buildx build -t ${IMAGENAME} .
docker push ${IMAGENAME}
done