Skip to content

Commit

Permalink
feat: github workflow create image for ghcr.io
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjackwills committed Mar 29, 2023
1 parent e0b49be commit cb1271c
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/create_release_and_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
deploy:
# Change this to latest - or ubuntu 20.04?
runs-on: ubuntu-18.04
steps:
- name: Checkout
Expand Down Expand Up @@ -64,23 +65,39 @@ jobs:
- name: compress windows_x86_64 binary
run: zip -j ./oxker_windows_x86_64.zip target/x86_64-pc-windows-gnu/release/oxker.exe

###############################
## Build images for Dockerhub #
###############################
#########################################
## Build images for Dockerhub & ghcr.io #
#########################################

- name: Login to GitHub Container Registry
uses: docker/#-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to DockerHub
uses: docker/#-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Write release version to env
run: |
CURRENT_SEMVER=${GITHUB_REF_NAME#v}
echo "CURRENT_SEMVER=$CURRENT_SEMVER" >> $GITHUB_ENV
- uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true
- name: Build for Docker Hub
- name: Build for Dockerhub & ghcr.io
run: |
docker build --platform linux/arm/v6,linux/arm64,linux/amd64 \
-t ${{ secrets.DOCKERHUB_USERNAME }}/oxker:latest \
-t ${{ secrets.DOCKERHUB_USERNAME }}/oxker:${{env.CURRENT_SEMVER}} \
-t ghcr.io/${{ github.repository_owner }}/oxker:latest \
-t ghcr.io/${{ github.repository_owner }}/oxker:${{env.CURRENT_SEMVER}} \
--push \
-f containerised/Dockerfile .
Expand Down

0 comments on commit cb1271c

Please # to comment.