diff --git a/.github/workflows/deploy-containers.yml b/.github/workflows/deploy-containers.yml new file mode 100644 index 0000000..d2ffd11 --- /dev/null +++ b/.github/workflows/deploy-containers.yml @@ -0,0 +1,29 @@ +name: deploy-containers + +on: + push: + paths: + - 'containers/**' + +jobs: + test-containers: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: test containers + run: | + cd container + ./test + + deploy-containers: + runs-on: ubuntu-latest + needs: test-containers + steps: + - uses: actions/checkout@v2 + - name: deploy containers + run: | + cd containers + ./deploy + env: + QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }} + QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }} diff --git a/.github/workflows/deploy-packages.yml b/.github/workflows/deploy-packages.yml new file mode 100644 index 0000000..15ee70c --- /dev/null +++ b/.github/workflows/deploy-packages.yml @@ -0,0 +1,29 @@ +name: deploy-packages + +on: + push: + paths: + - 'packages/**' + +jobs: + test-packages: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: test packages + run: | + yarn install + yarn test + + deploy-packages: + runs-on: ubuntu-latest + needs: test-packages + steps: + - uses: actions/checkout@v2 + - name: deploy packages + run: | + cd packages + ./deploy + continue-on-error: true + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 067ad29..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: deploy - -on: - push: - tags: - - '*' - -jobs: - deploy-containers: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: deploy containers - run: | - ./bin/deploy_containers - env: - QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }} - QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }} - - deploy-node-modules: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: deploy node modules - run: | - ./bin/deploy_node_modules - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - - deploy-web-extensions: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: deploy web extensions - run: | - ./bin/deploy_web_extensions - env: - EXTENSION_ID: ${{ secrets.EXTENSION_ID }} - CLIENT_ID: ${{ secrets.CLIENT_ID }} - CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} - REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }} - WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }} - WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 025fb86..27e3085 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,3 +51,12 @@ jobs: python -m pip install --upgrade pip python -m pip install -r requirements.txt python manage.py test + + test-containers: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: test containers + run: | + cd container + ./test \ No newline at end of file diff --git a/bin/deploy_containers b/containers/deploy similarity index 93% rename from bin/deploy_containers rename to containers/deploy index 1439a7f..af372d0 100755 --- a/bin/deploy_containers +++ b/containers/deploy @@ -16,12 +16,10 @@ set -o pipefail set -o nounset function build_and_push_container { - pushd containers container=$1 docker build --tag lesspass/${container} ./${container} docker tag lesspass/${container} quay.io/lesspass/${container} docker push quay.io/lesspass/${container} - popd } function build_and_push_containers { @@ -29,6 +27,7 @@ function build_and_push_containers { build_and_push_container webserver build_and_push_container backend build_and_push_container frontend + build_and_push_container blog } build_and_push_containers \ No newline at end of file diff --git a/bin/deploy_node_modules b/packages/deploy similarity index 93% rename from bin/deploy_node_modules rename to packages/deploy index 8497e29..d7c29f9 100755 --- a/bin/deploy_node_modules +++ b/packages/deploy @@ -21,7 +21,7 @@ function push_packages_on_npm { projects="lesspass lesspass-crypto lesspass-entropy lesspass-fingerprint lesspass-pure lesspass-render-password" for project in ${projects} do - pushd packages/${project} + pushd ${project} yarn publish --non-interactive popd done