Skip to content

Update docker/setup-buildx-action action to v3 (#15) #28

Update docker/setup-buildx-action action to v3 (#15)

Update docker/setup-buildx-action action to v3 (#15) #28

Workflow file for this run

name: ci
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Dockerhub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set Version
run: |
GIT_HASH=$(git rev-parse --short "$GITHUB_SHA")
echo "VERSION=$(cat VERSION).$GIT_HASH" >> $GITHUB_ENV
echo "APP_VERSION=$(cut -d'-' -f 1 VERSION)" >> $GITHUB_ENV
- name: Build and Push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
builder: ${{ steps.buildx.outputs.name }}
push: ${{ github.event_name != 'pull_request' }}
build-args: VERSION=${{ env.APP_VERSION }}
tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/multi-downloader-nx:latest
${{ secrets.DOCKER_HUB_USERNAME }}/multi-downloader-nx:${{ env.VERSION }}
cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/multi-downloader-nx:buildcache
cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/multi-downloader-nx:buildcache,mode=max