feat: github workflow create image for ghcr.io
This commit is contained in:
@@ -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
|
||||
@@ -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/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-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 .
|
||||
|
||||
|
||||
Reference in New Issue
Block a user