From 56bf4866145ced2f56fec98da4d0dfd3617711ce Mon Sep 17 00:00:00 2001 From: Julian van Dijk Date: Fri, 3 Dec 2021 12:18:28 +0100 Subject: [PATCH] github actions deployment (#108) * Create docker.yaml * Update docker.yaml * Update Dockerfile * Delete .travis.yml * Update docker.yaml * Update docker.yaml --- .github/workflows/docker.yaml | 34 ++++++++++++++++++++++++++++++++++ .travis.yml | 18 ------------------ Dockerfile | 2 +- 3 files changed, 35 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/docker.yaml delete mode 100644 .travis.yml diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml new file mode 100644 index 0000000..8ec9976 --- /dev/null +++ b/.github/workflows/docker.yaml @@ -0,0 +1,34 @@ +name: Docker +on: + push: + schedule: + - cron: '0 17 * * WED' + workflow_dispatch: +jobs: + buildDockerImage: + name: Build Docker image + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + images: ghcr.io/areafiftylan/lancie-admin + tags: type=sha, prefix={{date 'YYYYMMDD'}}- + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + context: . + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + push: ${{ github.ref == 'refs/heads/master' }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b484df0..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: generic -services: -- docker -# At least Docker 17.05 is needed for multi-stage builds, so upgrade -before_install: - - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - - - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" - - sudo apt-get update - - sudo apt-get -y install docker-ce -script: -- docker build --no-cache --pull -t quay.io/areafiftylan/lancie-admin:$TRAVIS_BUILD_NUMBER . -after_success: -- if [ "${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" == "master" ]; then - docker login quay.io -u="$QUAY_USERNAME" -p="$QUAY_PASSWORD"; - docker push quay.io/areafiftylan/lancie-admin:$TRAVIS_BUILD_NUMBER; - fi -notifications: - email: false diff --git a/Dockerfile b/Dockerfile index ffffe95..f60c418 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:8 AS builder +FROM node:12 AS builder WORKDIR /src COPY . . RUN docker/dockerbuild.sh