Data Security Service - Version 1.0.0 #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 push Docker image to GitHub Packages | |
# Trigger the workflow on release creation for the main branch: | |
on: | |
release: | |
types: [released] | |
jobs: | |
docker_image_build_and_push: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
# Checkout the repository: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# Log in to GitHub Docker Registry (GitHub Packages): | |
- name: Log in to GitHub Docker Registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
# Build the Docker image: | |
- name: Build Docker image | |
run: docker build -t ghcr.io/${{ github.repository }}:latest . | |
# Push the Docker image to GitHub Packages: | |
- name: Push Docker image to GitHub Packages | |
run: docker push ghcr.io/${{ github.repository }}:latest | |
# Tag the Docker image with the release version: | |
- name: Tag the Docker image with the release version | |
run: docker tag ghcr.io/${{ github.repository }}:latest ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name }} | |
# Push the Docker image with the release version to GitHub Packages: | |
- name: Push the Docker image with the release version to GitHub Packages | |
run: docker push ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name }} |