v3.2.0 #58
Workflow file for this run
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: bin-downloader | |
on: | |
release: | |
types: [created] | |
jobs: | |
buildx: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Prepare | |
id: prepare | |
run: | | |
DOCKER_HUB_IMAGE=grycap/oscar-bin-downloader | |
GHCR_IMAGE=ghcr.io/grycap/oscar-bin-downloader | |
DOCKER_PLATFORMS=linux/amd64,linux/arm64 | |
if [[ $GITHUB_REF == refs/tags/* ]]; then | |
VERSION=${GITHUB_REF#refs/tags/v} | |
fi | |
TAGS="--tag ${DOCKER_HUB_IMAGE}:latest --tag ${GHCR_IMAGE}:latest" | |
if [[ ! -z "$VERSION" ]]; then | |
TAGS="$TAGS --tag ${DOCKER_HUB_IMAGE}:${VERSION} --tag ${GHCR_IMAGE}:${VERSION}" | |
fi | |
echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} \ | |
${TAGS} --file tools/oscar-bin-downloader/Dockerfile tools/oscar-bin-downloader | |
- name: Set up Docker Buildx | |
uses: crazy-max/[email protected] | |
- name: Docker Hub login | |
env: | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
run: echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin | |
- name: GHCR login | |
env: | |
GHCR_USERNAME: ${{ secrets.GHCR_USERNAME }} | |
GHCR_PASSWORD: ${{ secrets.GHCR_PASSWORD }} | |
run: echo "${GHCR_PASSWORD}" | docker login ghcr.io --username "${GHCR_USERNAME}" --password-stdin | |
- name: Build and Push | |
run: docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }} | |
- name: Clear | |
if: always() | |
run: rm -f ${HOME}/.docker/config.json | |