Add an endpoint to allow an admin user to bulk delete rooms #12
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 Deploy | |
on: | |
push: | |
pull_request: | |
branches: [ master ] | |
workflow_dispatch: | |
env: | |
GO_VERSION: 1.19 | |
CI_REGISTRY_IMAGE: "${{ secrets.CI_REGISTRY }}/yeetserv" | |
GHCR_REGISTRY: ghcr.io | |
GHCR_REGISTRY_IMAGE: "ghcr.io/${{ github.repository }}" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go ${{ env.GO_VERSION }} | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
cache: true | |
- name: Install dependencies | |
run: sudo apt-get install libolm-dev libolm3 | |
- name: Build | |
run: go build -v | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: yeetserv | |
path: yeetserv | |
if-no-files-found: error | |
build-docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Beeper Docker registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ secrets.CI_REGISTRY }} | |
username: ${{ secrets.CI_REGISTRY_USER }} | |
password: ${{ secrets.CI_REGISTRY_PASSWORD }} | |
- name: Login to ghcr | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.GHCR_REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Pull latest | |
run: | | |
docker pull ${{ env.CI_REGISTRY_IMAGE }}:latest || true | |
- name: Docker Build | |
uses: docker/build-push-action@v2 | |
with: | |
cache-from: ${{ env.CI_REGISTRY_IMAGE }}:latest | |
file: Dockerfile | |
tags: | | |
${{ env.CI_REGISTRY_IMAGE }}:${{ github.sha }} | |
${{ env.GHCR_REGISTRY_IMAGE }}:${{ github.sha }} | |
push: true | |
deploy-docker: | |
runs-on: ubuntu-latest | |
needs: | |
- build-docker | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- name: Login to Beeper Docker registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ secrets.CI_REGISTRY }} | |
username: ${{ secrets.CI_REGISTRY_USER }} | |
password: ${{ secrets.CI_REGISTRY_PASSWORD }} | |
- name: Login to ghcr | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.GHCR_REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Tag latest on Beeper Docker registry | |
run: | | |
docker pull ${{ env.CI_REGISTRY_IMAGE }}:${{ github.sha }} | |
docker tag ${{ env.CI_REGISTRY_IMAGE }}:${{ github.sha }} ${{ env.CI_REGISTRY_IMAGE }}:latest | |
docker push ${{ env.CI_REGISTRY_IMAGE }}:latest | |
- name: Tag latest on ghcr | |
run: | | |
docker pull ${{ env.GHCR_REGISTRY_IMAGE }}:${{ github.sha }} | |
docker tag ${{ env.GHCR_REGISTRY_IMAGE }}:${{ github.sha }} ${{ env.GHCR_REGISTRY_IMAGE }}:latest | |
docker push ${{ env.GHCR_REGISTRY_IMAGE }}:latest |