Last active
February 1, 2022 03:18
-
-
Save BoredHackerBlog/f9f5cb7c809e3b03d38bc7f4c1438fbb to your computer and use it in GitHub Desktop.
github actions for docker containers
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 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