Skip to content

Instantly share code, notes, and snippets.

@amessinger
Created July 5, 2021 16:48
Show Gist options
  • Save amessinger/dd99cc649c5983198ce60626c2fdc926 to your computer and use it in GitHub Desktop.
Save amessinger/dd99cc649c5983198ce60626c2fdc926 to your computer and use it in GitHub Desktop.
name: Container image
on:
push:
branches: [ master ]
jobs:
build-push:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ghcr.io/organization/repository:latest
cache-from: type=registry,ref=ghcr.io/organization/repository:latest
cache-to: type=inline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment