Skip to content
This repository has been archived by the owner on Feb 26, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2 from korosuke613/upload-ghcr
Browse files Browse the repository at this point in the history
ci: upload docker
  • Loading branch information
korosuke613 authored Mar 21, 2021
2 parents 49660ad + 9fa7c05 commit e1933e7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
30 changes: 27 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,31 @@ jobs:
fi
git checkout -b "$branch" || true
- run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.5.7/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'"
- name: Earthly version
run: earthly --version
- name: Run lint
- name: +release
run: earthly --secret GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} --ci --use-inline-cache --push +release

docker:
name: +docker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Put back the git branch into git (Earthly uses it for tagging)
run: |
branch=""
if [ -n "$GITHUB_HEAD_REF" ]; then
branch="$GITHUB_HEAD_REF"
else
branch="${GITHUB_REF##*/}"
fi
git checkout -b "$branch" || true
- run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.5.7/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'"
- name: +docker
run: earthly --secret GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} --ci --use-inline-cache --push +docker
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PAT }}
- run: docker tag tempura:latest ghcr.io/korosuke613/tempura:${GITHUB_REF##*/}
- run: docker push ghcr.io/korosuke613/tempura:${GITHUB_REF##*/}
3 changes: 1 addition & 2 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,4 @@ docker:

COPY +build/tempura /tempura
ENTRYPOINT ["/tempura"]
SAVE IMAGE go-tempura:latest

SAVE IMAGE tempura:latest

0 comments on commit e1933e7

Please sign in to comment.