Merge pull request #21 from PoloLacoste/PoloLacoste-patch-1 #45
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-Api CI | |
on: | |
push: | |
branches: [ main ] | |
tags: | |
- '*.*.*' | |
jobs: | |
#tests: | |
# name: Tests | |
# runs-on: ubuntu-latest | |
# | |
# strategy: | |
# matrix: | |
# node-version: [14.x] | |
# | |
# steps: | |
# - uses: actions/checkout@v2 | |
# | |
# - name: Use Node.js ${{ matrix.node-version }} | |
# uses: actions/setup-node@v1 | |
# with: | |
# node-version: ${{ matrix.node-version }} | |
# - run: npm ci | |
# - run: npm run build --if-present | |
# - run: npm run test:e2e | |
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-api:${{ 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-api |