Skip to content

Instantly share code, notes, and snippets.

@masious
Created September 5, 2023 10:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masious/ef3d9dbfc38c922368c0d1892d040b6c to your computer and use it in GitHub Desktop.
Save masious/ef3d9dbfc38c922368c0d1892d040b6c to your computer and use it in GitHub Desktop.
Github Actions example: .github/workflows/build.yml
name: Docker Image CI
on:
push:
branches: [ "master" ]
jobs:
build:
permissions: write-all
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Login to Github Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push (front)
uses: docker/build-push-action@v4
with:
push: true
file: Dockerfile.frontend
tags: ghcr.io/masious/my-front
cache-from: type=registry,ref=ghcr.io/masious/my-front
cache-to: type=inline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment