add template documentation #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
####################################################### | |
### example for Docker Hub | |
### | |
### Your container image name will be: | |
### <DOCKERHUB_USERNAME>/<github-account>-<repo-name>:latest | |
### | |
####################################################### | |
####################################################### | |
# Requirements: | |
# | |
# 1. You must have a dockerhub access token | |
# Ref: https://docs.docker.com/security/for-developers/access-tokens/ | |
# | |
# 2. You must add your dockerhub username & access token as Github Actions secrets | |
# Ref: https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions | |
# | |
# Go to your repository Settings > Secrets & Variables > Actions | |
# > Repository secrets > New repository secret | |
# | |
# Add (from step #1) your: | |
# DOCKERHUB_USERNAME | |
# DOCKERHUB_TOKEN | |
####################################################### | |
####################################################### | |
### Uncomment all lines below to use this template ### | |
####################################################### | |
# name: "Docker build & push - Dockerhub" | |
# | |
# concurrency: | |
# group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
# cancel-in-progress: true | |
# | |
# on: | |
# pull_request: | |
# types: [closed] | |
# push: | |
# workflow_dispatch: | |
# | |
# env: | |
# DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
# | |
# jobs: | |
# docker-build-push: | |
# runs-on: ubuntu-latest | |
# permissions: | |
# packages: write | |
# | |
# steps: | |
# - name: Set IMAGE_NAME | |
# run: | | |
# echo "IMAGE_NAME=${{ env.DOCKERHUB_USERNAME }}/$(echo "${{ github.repository }}" | sed 's|/|-|'):latest" >> $GITHUB_ENV | |
# | |
# - name: Checkout repository | |
# uses: actions/checkout@v4 | |
# | |
# - name: Set up QEMU | |
# uses: docker/setup-qemu-action@v3 | |
# | |
# - name: Set up Docker Buildx | |
# uses: docker/setup-buildx-action@v3 | |
# | |
# - name: Log in to the Container registry | |
# uses: docker/login-action@v3 | |
# with: | |
# username: ${{ secrets.DOCKERHUB_USERNAME }} | |
# password: ${{ secrets.DOCKERHUB_TOKEN }} | |
# | |
# - name: "Build and push Docker image" | |
# uses: docker/build-push-action@v6 | |
# with: | |
# push: true | |
# tags: ${{env.IMAGE_NAME}} |