diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 42db92d52cc..246ca5c500f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -71,24 +71,31 @@ jobs: - name: Build run: | - chmod +x ./build.sh - ./build.sh + echo -e "# Building Web\n" + echo "Building app" + echo "npm version $(npm --version)" + npm install + npm run dist:selfhost + + echo -e "\nBuilding docker image" + docker --version + docker build -t bitwarden/web . - name: Tag rc branch if: github.ref == 'refs/heads/rc' - run: ./build.sh tag rc + run: docker tag bitwarden/web bitwarden/web:rc - name: Tag dev if: github.ref == 'refs/heads/master' || github.event_name == 'release' - run: ./build.sh tag dev + run: docker tag bitwarden/web bitwarden/web:dev - name: Tag beta if: github.event_name == 'release' - run: ./build.sh tag beta + run: docker tag bitwarden/web bitwarden/web:beta - name: Tag version if: github.event_name == 'release' - run: ./build.sh tag $($env:RELEASE_TAG_NAME.trimStart('v')) + run: docker tag bitwarden/web:$($env:RELEASE_TAG_NAME.trimStart('v')) shell: pwsh env: RELEASE_TAG_NAME: ${{ github.event.release.tag_name }} @@ -99,35 +106,35 @@ jobs: - name: Push rc images if: github.ref == 'refs/heads/rc' - run: ./build.sh push rc + run: docker push bitwarden/web:rc env: DOCKER_CONTENT_TRUST: 1 DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ secrets.DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE }} - name: Push dev images if: github.ref == 'refs/heads/master' || github.event_name == 'release' - run: ./build.sh push dev + run: docker push bitwarden/web:dev env: DOCKER_CONTENT_TRUST: 1 DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ secrets.DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE }} - name: Push beta images if: github.event_name == 'release' - run: ./build.sh push beta + run: docker push bitwarden/web:beta env: DOCKER_CONTENT_TRUST: 1 DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ secrets.DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE }} - name: Push latest images if: github.event_name == 'release' - run: ./build.sh push latest + run: docker push bitwarden/web:latest env: DOCKER_CONTENT_TRUST: 1 DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ secrets.DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE }} - name: Push version images if: github.event_name == 'release' - run: ./build.sh push $($env:RELEASE_TAG_NAME.trimStart('v')) + run: docker push bitwarden/web:$($env:RELEASE_TAG_NAME.trimStart('v')) shell: pwsh env: RELEASE_TAG_NAME: ${{ github.event.release.tag_name }} diff --git a/build.sh b/build.sh deleted file mode 100644 index 88a3c954b13..00000000000 --- a/build.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash -set -e - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -echo "" - -if [ $# -gt 1 -a "$1" == "push" ] -then - TAG=$2 - echo "# Pushing Web ($TAG)" - echo "" - docker push bitwarden/web:$TAG -elif [ $# -gt 1 -a "$1" == "tag" ] -then - TAG=$2 - echo "Tagging Web as '$TAG'" - docker tag bitwarden/web bitwarden/web:$TAG -else - echo "# Building Web" - - echo "" - echo "Building app" - echo "npm version $(npm --version)" - npm install - npm run sub:update - npm run dist:selfhost - - echo "" - echo "Building docker image" - docker --version - docker build -t bitwarden/web $DIR/. -fi