-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploy unstable/unreleased snage version to snage.ff-labs.de
- Loading branch information
Showing
2 changed files
with
18 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,26 +17,35 @@ jobs: | |
- run: yarn lerna run build | ||
env: | ||
BUILD_VERSION: ${{ env.VERSION }} | ||
- name: Publish to Docker and NPM | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
- name: Publish master as snage/snage:unstable to Docker | ||
if: github.ref == 'refs/heads/master' | ||
run: | | ||
echo "$DOCKER_PASS" | docker login --username "$DOCKER_USER" --password-stdin | ||
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > $HOME/.npmrc | ||
docker build -t snage/snage:${VERSION} packages/snage | ||
docker push snage/snage:${VERSION} | ||
(cd packages/snage && yarn publish --new-version "${VERSION}" --no-git-tag-version) | ||
docker build -t snage/snage:unstable packages/snage | ||
docker push snage/snage:unstable | ||
env: | ||
DOCKER_USER: ${{ secrets.DOCKER_USER }} | ||
DOCKER_PASS: ${{ secrets.DOCKER_PASS }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
- name: Deploy snage.ff-labs.de | ||
if: github.ref == 'refs/heads/master' | ||
run: | | ||
export SNAGE_VERSION=$(git describe --tags --abbrev=0 | sed 's/^v//') | ||
export ANSIBLE_PRIVATE_KEY_FILE="$HOME/id_rsa" | ||
echo "$SSH_KEY" > $HOME/id_rsa | ||
chmod 600 $HOME/id_rsa | ||
ansible-playbook -i [email protected], -e "SNAGE_VERSION=${SNAGE_VERSION}" ansible/deploy-snage.yml | ||
ansible-playbook -i [email protected], -e "SNAGE_VERSION=unstable" ansible/deploy-snage.yml | ||
env: | ||
SSH_KEY: ${{ secrets.SSH_KEY }} | ||
ANSIBLE_HOST_KEY_CHECKING: false | ||
- name: Publish Release to Docker and NPM | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
run: | | ||
echo "$DOCKER_PASS" | docker login --username "$DOCKER_USER" --password-stdin | ||
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > $HOME/.npmrc | ||
docker build -t snage/snage:${VERSION} packages/snage | ||
docker push snage/snage:${VERSION} | ||
(cd packages/snage && yarn publish --new-version "${VERSION}" --no-git-tag-version) | ||
env: | ||
DOCKER_USER: ${{ secrets.DOCKER_USER }} | ||
DOCKER_PASS: ${{ secrets.DOCKER_PASS }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters