2022-12-01 14:34:41 +01:00
|
|
|
name: Build and push to repository
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ "main" ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-and-push:
|
|
|
|
name: Build Docker image and push to repository
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Set up Docker buildx
|
|
|
|
id: buildx
|
|
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
|
|
|
|
- name: Login to repository
|
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
|
|
|
registry: ${{ secrets.REGISTRY_URL }}
|
|
|
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
|
|
|
|
- name: Build image and push to registry
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
2023-09-18 14:02:59 +02:00
|
|
|
file: ./Dockerfile
|
2022-12-01 14:34:41 +01:00
|
|
|
tags: |
|
|
|
|
${{ secrets.REGISTRY_URL }}/spoticord/spoticord:latest
|
|
|
|
push: ${{ github.ref == 'refs/heads/main' }}
|