~tyil/www-fglt.nl

fe1569587f574ccdd12c991e71f3259cf4a64e69 — Patrick Spek 28 days ago b6ed33a
Update GitLab CI with Quay credentials
2 files changed, 10 insertions(+), 10 deletions(-)

M .builds/docker.yml
M .gitlab-ci.yml
M .builds/docker.yml => .builds/docker.yml +6 -1
@@ 3,12 3,12 @@ sources:
  - https://git.sr.ht/~tyil/www-fglt.nl
packages:
  - docker
  - ruby-bundler
  - ruby-dev
secrets:
  - 4577a183-953e-4612-a48b-e48c4c4763c9
tasks:
  - prepare: |
      # Configure Docker
      sudo mkdir -p /etc/docker
      cat <<-EOF > /tmp/dockerd.json
      {


@@ 17,6 17,11 @@ tasks:
      EOF
      sudo mv /tmp/dockerd.json /etc/docker/daemon.json
      sudo rc-service docker start

      # Install latest bundler gem
      sudo gem install bundler

      hash -r
  - build: |
      cd www-fglt.nl
      bundle install --verbose

M .gitlab-ci.yml => .gitlab-ci.yml +4 -9
@@ 6,7 6,7 @@ Build Docker image:
  stage: build
  image: ruby:latest
  before_script:
    - gem install bundler:1.17.2
    - gem install bundler
    - bundle install
  script:
    - bundle exec jekyll build


@@ 21,13 21,8 @@ Push Docker image:
  image: docker:stable
  services:
    - docker:dind
  variables:
    DOCKER_HOST: tcp://docker:2375
    DOCKER_DRIVER: overlay2
  before_script:
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
    - docker login -u $QUAY_USER -p $QUAY_PASSWORD quay.io
  script:
    - docker build -t $CI_REGISTRY_IMAGE:latest .
    - docker push $CI_REGISTRY_IMAGE:latest
    - docker tag $CI_REGISTRY_IMAGE:latest $CI_REGISTRY_IMAGE:ci-$CI_COMMIT_SHA
    - docker push $CI_REGISTRY_IMAGE:ci-$CI_COMMIT_SHA
    - docker build -t $QUAY_REPOSITORY:latest $QUAY_REPOSITORY:ci-$CI_COMMIT_SHA .
    - docker push $QUAY_REPOSITORY:latest $QUAY_REPOSITORY:ci-$CI_COMMIT_SHA