updated FAQ to match server #2
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: Build and push Docker image | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "*" | |
jobs: | |
docker: | |
name: Build and push Docker image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Set repo owner to lowercase | |
run: echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
- name: Setup Docker buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# Use 'latest' for the main branch, otherwise use the tag name | |
- name: Set image tag | |
run: echo "IMAGE_TAG=$(if [ ${{ github.ref }} = 'refs/heads/main' ]; then echo 'latest'; else echo ${{ github.ref }} | sed -e 's/refs\/tags\///g'; fi)" >> $GITHUB_ENV | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: true | |
tags: ghcr.io/${{ env.REPO_OWNER }}/slopcrew-server:${{ env.IMAGE_TAG }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |