Skip to content

updated gh secrets

updated gh secrets #2

Workflow file for this run

name: Docker build & release
on:
push:
tags: ['v*']
jobs:
build:
name: Build Docker image
runs-on: ubuntu-22.04
steps:
- uses: docker/setup-buildx-action@v3
with:
install: true
driver-opts: network=host
- uses: actions/checkout@v4
- name: Get version
id: version
run: |
echo indico_version="${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
echo indico_version="${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Extract metadata (tags, labels) for Docker πŸ‘€
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/indico
getindico/indico
tags: |
type=semver,pattern={{version}},value=${{ steps.version.outputs.indico_version }}
type=semver,pattern={{major}}.{{minor}}.x,value=${{ steps.version.outputs.indico_version }}
- name: Build Docker image 🚒
uses: docker/build-push-action@v5
with:
context: indico/worker
platforms: linux/amd64,linux/arm64
build-args: tag=${{ steps.version.outputs.indico_version }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=docker,dest=/tmp/indico-image.tar
- name: Test if Indico works πŸ§ͺ
run: |
docker load --input /tmp/indico-image.tar
cp indico.env.sample indico.env
sed -i -E 's/image: getindico\/indico:latest/image: getindico\/indico:${indico_version}/' docker-compose.yml
./test.sh
- name: Get unique run id
id: unique_id
run: |
echo "cache_key=${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> $GITHUB_OUTPUT
- name: Upload build artifact πŸ”Ό
uses: actions/cache@v3
with:
key: indico-image-${{ steps.unique_id.outputs.cache_key }}
path: /tmp/indico-image.tar
publish-ghcr:
name: Publish to GHCR πŸ™
needs: build
runs-on: ubuntu-22.04
environment: publish-ghcr
permissions:
packages: write
steps:
- name: Get unique run id
id: unique_id
run: |
echo "cache_key=${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> $GITHUB_OUTPUT
- name: Download build artifact πŸ”½
uses: actions/cache@v3
with:
key: indico-image-${{ steps.unique_id.outputs.cache_key }}
path: /tmp/indico-image.tar
- name: Import image
run: |
docker load --input /tmp/indico-image.tar
docker image ls -a | grep indico
- name: Log in to GHCR πŸ”‘
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push Docker image 🚒
run: |
docker push --all-tags ghcr.io/${{ github.repository_owner }}/indico
publish-dockerhub:
name: Publish to Docker Hub 🚒
needs: build
runs-on: ubuntu-22.04
environment: publish-dockerhub
steps:
- name: Get unique run id
id: unique_id
run: |
echo "cache_key=${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> $GITHUB_OUTPUT
- name: Download build artifact πŸ”½
uses: actions/cache@v3
with:
key: indico-image-${{ steps.unique_id.outputs.cache_key }}
path: /tmp/indico-image.tar
- name: Import image
run: |
docker load --input /tmp/indico-image.tar
docker image ls -a | grep indico
- name: Log in to Docker Hub πŸ”‘
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Push Docker image 🚒
run: |
docker push --all-tags getindico/indico