Skip to content

2024.9.10

2024.9.10 #1

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 }}