Include new build workflow

This commit is contained in:
Daniel García 2021-09-12 23:00:23 +02:00
parent 3a0d62948b
commit 17b48c3a85
No known key found for this signature in database
GPG key ID: FC8A7D14C3CD543A
3 changed files with 43 additions and 2 deletions

41
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,41 @@
name: Release
on:
push:
tags:
- 'v[0-9.]+[a-z]*'
jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
- name: Login to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 # v1.10.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Determine Docker Tag
- name: Init Variables
id: vars
shell: bash
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "set-output name=DOCKER_TAG::${GITHUB_REF#refs/*/}"
echo "::set-output name=DOCKER_TAG::${GITHUB_REF#refs/*/}"
elif [[ "${{ github.ref }}" == refs/heads/* ]]; then
echo "set-output name=DOCKER_TAG::testing"
echo "::set-output name=DOCKER_TAG::testing"
fi
- name: Build and push
uses: docker/build-push-action@a66e35b9cbcf4ad0ea91ffcaf7bbad63ad9e0229 # v2.7.0
with:
context: .
push: true
# secrets.DOCKERHUB_REPO needs to be '<user>/<repo>', for example 'vaultwarden/web-vault'
tags: "${{ secrets.DOCKERHUB_REPO }}:${{ steps.vars.outputs.DOCKER_TAG }}"

View file

@ -25,8 +25,8 @@ USER node
# Can be a tag, release, but prefer a commit hash because it's not changeable # Can be a tag, release, but prefer a commit hash because it's not changeable
# https://github.com/bitwarden/web/commit/$VAULT_VERSION # https://github.com/bitwarden/web/commit/$VAULT_VERSION
# #
# Using https://github.com/bitwarden/web/releases/tag/v2.22.2 # Using https://github.com/bitwarden/web/releases/tag/v2.22.3
ARG VAULT_VERSION=2fe196df5e8b8b7494218ae0fd08d4db79eceb05 ARG VAULT_VERSION=cfefcf7876f3ef56e707b4ca6bd6b0135c0118d3
RUN git clone https://github.com/bitwarden/web.git /vault RUN git clone https://github.com/bitwarden/web.git /vault
WORKDIR /vault WORKDIR /vault