2024.9.10 #1
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 (Main) | |
on: | |
release: | |
types: [created] # Triggers when a release is created | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout the repository | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Step 2: Login to Docker | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ vars.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
# Step 3: Build and Push Docker image (Docker CLI is pre-installed in GitHub-hosted runners) | |
- name: Build and Push Docker Image | |
run: | | |
# Build the Docker image | |
docker build -t ${{ vars.DOCKERHUB_USERNAME }}/littlelink:${{ github.event.release.tag_name }} . | |
# Push the Docker image to Docker Hub | |
docker push ${{ vars.DOCKERHUB_USERNAME }}/littlelink:${{ github.event.release.tag_name }} |