Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Update README.md

Update README.md #831

Workflow file for this run

name: Build standalone Docker image
on:
push:
tags:
- "*"
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build:
name: Build Docker Images
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set build platforms
id: platform
run: |
if [ "${{ github.ref_type }}" = tag ]; then
echo "::set-output name=latest::true"
else
echo "::set-output name=latest::false"
fi
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: |
ghcr.io/someengineering/resoto-ui
flavor: |
latest=${{ steps.platform.outputs.latest }}
tags: |
type=pep440,pattern={{version}}
type=pep440,pattern={{major}}.{{minor}}
type=pep440,pattern={{major}}
type=sha,prefix=
type=edge
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
- name: Log in to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
build-args: |
SOURCE_COMMIT=${{ github.sha }}
GITHUB_REF=${{ github.ref }}
GITHUB_REF_TYPE=${{ github.ref_type }}
GITHUB_EVENT_NAME=${{ github.event_name }}
TESTS=false
RESOTO_UI_DO_API_TOKEN=${{ secrets.RESOTO_UI_DO_API_TOKEN }}
RESOTO_UI_SPACES_KEY=${{ secrets.RESOTO_UI_SPACES_KEY }}
RESOTO_UI_SPACES_SECRET=${{ secrets.RESOTO_UI_SPACES_SECRET }}
RESOTO_UI_SPACES_NAME=${{ secrets.RESOTO_UI_SPACES_NAME }}
RESOTO_UI_SPACES_PATH=${{ secrets.RESOTO_UI_SPACES_PATH }}
RESOTO_UI_SPACES_REGION=${{ secrets.RESOTO_UI_SPACES_REGION }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache