forked from sethcottle/littlelink
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,32 @@ | ||
name: Docker image (dev) | ||
name: Build and Push Docker Image (Dev) | ||
|
||
on: | ||
push: | ||
branches: | ||
- "dev" | ||
- dev # Adjust this to your preferred branch | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- | ||
name: Login to Docker Hub | ||
# 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 }} | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
tags: ${{ vars.DOCKERHUB_USERNAME }}/littlelink:dev | ||
|
||
# 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:dev . | ||
# Push the Docker image to Docker Hub | ||
docker push ${{ vars.DOCKERHUB_USERNAME }}/littlelink:dev |