Skip to content

Instantly share code, notes, and snippets.

@BoredHackerBlog
Last active February 1, 2022 03:18
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 BoredHackerBlog/f9f5cb7c809e3b03d38bc7f4c1438fbb to your computer and use it in GitHub Desktop.
Save BoredHackerBlog/f9f5cb7c809e3b03d38bc7f4c1438fbb to your computer and use it in GitHub Desktop.
github actions for docker containers
name: build and upload container
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run build
run: docker build -t ${{ github.event.repository.name }} .
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
- name: Tag Image
run: docker tag ${{ github.event.repository.name }}:latest docker.pkg.github.com/boredhackerblog/${{ github.event.repository.name }}/${{ github.event.repository.name }}
- name: Push Image
run: docker push docker.pkg.github.com/boredhackerblog/${{ github.event.repository.name }}/${{ github.event.repository.name }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment