Update README.md #31
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
# Build Docker image of Iamus metaverse-server and publish in | |
# Github Container Registry as "vircadia/Iamus". | |
name: Iamus Docker image | |
on: | |
# Create Docker image on push to 'master' | |
push: | |
branches: | |
- master | |
env: | |
# Names used to tag built Docker image | |
IMAGE_NAME: iamus | |
# The local Docker image is named env.IMAGE_TAG so it can be referenced and pushed | |
IMAGE_TAG: iamus:latest | |
jobs: | |
push: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the repository into current runner context | |
- name: checkout | |
uses: actions/checkout@v2 | |
# Setup buildx environment (used if building for multiple platforms) | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v1 | |
# Build Iamus | |
- name: Build | |
uses: docker/build-push-action@v2 | |
with: | |
context: ./docker | |
platforms: linux/amd64 | |
# platforms: linux/amd64,linux/arm64 | |
tags: ${{ env.IMAGE_TAG }} | |
# Get version information from built image. | |
# The unique version tag is generated during the build. Extract version string for image tagging. | |
- name: Fetch version information | |
run: | | |
IVERSION=$(docker run --rm --entrypoint "./GetVersion.sh" ${{ env.IMAGE_TAG }}) | |
echo "IVERSION=$IVERSION" | |
echo "IVERSION=$IVERSION" >> $GITHUB_ENV | |
# Login to Github Container Registry with this registry's tokens | |
- name: Login to Github Container registry | |
uses: docker/#-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# Push to Github Container Registry | |
- name: Push to Github Container Registry | |
run: | | |
docker image tag ${{ env.IMAGE_TAG }} ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest | |
docker image tag ${{ env.IMAGE_TAG }} ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ env.IVERSION }} | |
docker image push --all-tags ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} | |
# vim: tabstop=2 shiftwidth=2 autoindent expandtab |