Browse Source

test multiarch step

pull/1565/head
Borja García Rodríguez 4 years ago
parent
commit
220bc58289
1 changed files with 37 additions and 3 deletions
  1. +37
    -3
      .github/workflows/basket-api.yml

+ 37
- 3
.github/workflows/basket-api.yml View File

@ -93,8 +93,8 @@ jobs:
BuildWindows:
runs-on: windows-2019
# if: ${{ false }}
if: ${{ github.event_name != 'pull_request' }}
if: ${{ false }}
# if: ${{ github.event_name != 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
@ -124,4 +124,38 @@ jobs:
shell: pwsh
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ env.REGISTRY_ENDPOINT }}
REGISTRY: ${{ env.REGISTRY_ENDPOINT }}
BuildMultiarch:
runs-on: ubuntu-latest
needs:
- BuildLinux
if: ${{ github.event_name != 'pull_request' }}
steps:
- uses: actions/checkout@v2
- name: Login to Container Registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY_HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Create multiarch manifest
run: |
mkdir -p ~/.docker
sed '$ s/.$//' $DOCKER_CONFIG/config.json > ~/.docker/config.json
echo ',"experimental": "enabled" }' >> ~/.docker/config.json
docker --config ~/.docker manifest create ${{ env.REGISTRY_ENDPOINT }}/${{ env.SERVICES }}:${{ env.BRANCH }} ${{ env.REGISTRY_ENDPOINT }}/${{ env.SERVICES }}:linux-${{ env.BRANCH }}
docker --config ~/.docker manifest create ${{ env.REGISTRY_ENDPOINT }}/${{ env.SERVICES }}:latest ${{ env.REGISTRY_ENDPOINT }}/${{ env.SERVICES }}:linux-latest
docker --config ~/.docker manifest push ${{ env.REGISTRY_ENDPOINT }}/${{ env.SERVICES }}:${{ env.BRANCH }}
docker --config ~/.docker manifest push ${{ env.REGISTRY_ENDPOINT }}/${{ env.SERVICES }}:latest
shell: bash

Loading…
Cancel
Save