Skip to content

load image for docker #145

load image for docker

load image for docker #145

Workflow file for this run

name: Docker
on:
push:
branches:
- main
env:
IMAGE_NAME: toolbox
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image
run:
docker buildx build --platform linux/arm64,linux/amd64 --load -t "$IMAGE_NAME" .
- name: Log into github registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push image to github registry
run: |
IMAGE_ID=ghcr.io/${{ github.repository }}/$IMAGE_NAME
docker tag $IMAGE_NAME $IMAGE_ID:latest
docker tag $IMAGE_NAME $IMAGE_ID:${{ github.sha }}
docker push $IMAGE_ID:latest
docker push $IMAGE_ID:${{ github.sha }}
- name: Log into docker hub registry
run: echo "${{ secrets.DOCKER_HUB_TOKEN }}" | docker login -u apexskier --password-stdin
- name: Push image to docker hub registry
run: |
IMAGE_ID=apexskier/$IMAGE_NAME
docker tag $IMAGE_NAME $IMAGE_ID:latest
docker tag $IMAGE_NAME $IMAGE_ID:${{ github.sha }}
docker push $IMAGE_ID:latest
docker push $IMAGE_ID:${{ github.sha }}