From e329e6f3afeca8657ac8dbc8fb7f48a6f19d9522 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Thu, 4 Nov 2021 15:07:59 +0200 Subject: Add CI --- .github/workflows/somebook.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/somebook.yml diff --git a/.github/workflows/somebook.yml b/.github/workflows/somebook.yml new file mode 100644 index 0000000..b59293e --- /dev/null +++ b/.github/workflows/somebook.yml @@ -0,0 +1,34 @@ +name: Build and Push + +on: + push: + branches: + - main + +env: + IMAGE: registry.digitalocean.com/jan-systems-registry/somebook:latest + DO_DOCKER_LOGIN: ${{ secrets.DO_DOCKER_LOGIN }} + +jobs: + website: + name: Build and Push + runs-on: ubuntu-latest + environment: + name: production + url: https://book.jan.systems + + steps: + - name: Checkout + uses: actions/checkout@v2 + + # Login to Digitalocean registry + - name: Log in to Digitalocean registry + run: docker login -u ${DO_DOCKER_LOGIN} -p ${DO_DOCKER_LOGIN} registry.digitalocean.com + + # Build the Docker image + - name: Build image + run: docker build -t ${IMAGE} . + + # Push the Docker image to Google Container Registry + - name: Push image to registry + run: docker push ${IMAGE} -- cgit v1.3