1.7.2 (#17) #84
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: R6-Discord-bot CI | |
on: | |
push: | |
branches: [ main ] | |
tags: | |
- '*.*.*' | |
jobs: | |
build: | |
name: Build docker image and push to docker hub | |
runs-on: ubuntu-latest | |
env: | |
RELEASE_VERSION: latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set version from tag | |
run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Set if not main branch | |
if: ${{ github.ref != 'refs/heads/main' }} | |
run: echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Check output | |
run: echo $RELEASE_VERSION | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v2 | |
with: | |
push: true | |
tags: pololacoste/r6-discord-bot:${{ env.RELEASE_VERSION }} | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} | |
readme: | |
name: Push readme to docker hub | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Update repo description | |
uses: peter-evans/dockerhub-description@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
repository: pololacoste/r6-discord-bot |