feat: update docker file #14
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: Syft Task Build | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main # Only run this workflow on pushes to the main branch | |
jobs: | |
build: | |
# Check if the last commit is a merge from the `ui-changes` branch | |
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') | |
runs-on: ubuntu-latest | |
environment: docker | |
permissions: | |
id-token: write | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: GitHub Tag | |
id: tag_version | |
uses: mathieudutour/[email protected] | |
with: | |
github_token: ${{ secrets.GHCR_PAT }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log in to the Container Registry | |
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GHCR_PAT }} | |
- name: Switch to the Dockerfile directory | |
run: cd ./sender | |
- name: Build and Push Docker Image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: | | |
ghcr.io/${{ github.repository_owner }}/og-task-syft:${{ steps.tag_version.outputs.new_tag }} | |
file: ./sender/Dockerfile | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |