Merge pull request #2 from tegonal/renovate/docker-build-push-action-… #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and publish docker images | ||
on: | ||
push: | ||
tags: | ||
- '**' | ||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
attestations: write | ||
id-token: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@1f36f5b7a2d2f7bfd524795fc966e6d88c37baa9 | ||
with: | ||
Check failure on line 22 in .github/workflows/publish.yml GitHub Actions / Build and publish docker imagesInvalid workflow file
|
||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@70b2cdc6480c1a8b86edf1777157f8f437de2166 | ||
with: | ||
images: tegonal/cv-manager | ||
- name: Build and push Docker image | ||
id: push | ||
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
- name: Set Status Message | ||
id: set_status | ||
shell: bash | ||
run: | | ||
if [ "${{ job.status }}" == "success" ]; then | ||
echo "STATUS_MESSAGE=Build completed successfully, image pushed. ${{ steps.meta.outputs.tags }} ${{ steps.meta.outputs.labels }} :white_check_mark:" >> $GITHUB_ENV | ||
else | ||
echo "STATUS_MESSAGE=:boom: :boom: :boom: Build failed, more information is available in the GitHub action logs." >> $GITHUB_ENV | ||
fi | ||
- name: Mattermost Notification | ||
uses: mattermost/action-mattermost-notify@master | ||
with: | ||
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }} | ||
TEXT: | | ||
This is a message from ${{ github.repository }}. | ||
[Pipeline](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) ${{ env.STATUS_MESSAGE }} | ||
MATTERMOST_USERNAME: ${{ github.triggering_actor }} |