Build and Push Docker Image #1
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 | |
# Manually trigger the workflow | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout the code | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Step 2: Set up Docker Buildx | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
# Step 3: Log in to GitHub Packages Docker registry | |
- name: Log in to GitHub Packages | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
# Step 4: Build the Docker image | |
- name: Build Docker image | |
run: docker build . -t ghcr.io/${{ github.repository_owner }}/m3u-playlist-proxy:latest | |
# Step 5: Push the Docker image to GitHub Packages | |
- name: Push Docker image | |
run: docker push ghcr.io/${{ github.repository_owner }}/m3u-playlist-proxy:latest |