Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

Add pipeline to create image in Docker Hub #1

Add pipeline to create image in Docker Hub

Add pipeline to create image in Docker Hub #1

Workflow file for this run

name: Build 📦
on:
push:
tags:
- 'v*.*.*'
env:
REPOSITORY: docker.io/containerscrew/iproxy
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_AUTH_USERNAME }}
password: ${{ secrets.DOCKERHUB_AUTH_TOKEN }}
# Step to set Docker tag based on the generated GitHub tag
- name: Set container tag
id: set_tag
run: |
# Extract the tag name from the full reference
IMAGE_TAG=$(echo "${{ github.ref }}" | sed 's|.*/||')
echo "IMAGE_TAG=$IMAGE_TAG" >> "$GITHUB_ENV"
- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.REPOSITORY }}:latest,${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}