Skip to content

Commit

Permalink
Merge pull request #29 from badsyntax/upload-artifacts
Browse files Browse the repository at this point in the history
Upload artifacts to release
  • Loading branch information
badsyntax authored Aug 8, 2020
2 parents beeaf51 + 95bae28 commit 75ab487
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 4 deletions.
45 changes: 43 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,17 @@ jobs:
- name: Install dependencies
run: |
npm install
- name: Build
- name: Build dist
run: |
cat << CONFIG > src/config/config.json
{
"hostname": "/",
"mockApi": false
}
CONFIG
PUBLIC_URL=/admin/ npm run build
mv build dist
- name: Build demo
run: |
cat << CONFIG > src/config/config.json
{
Expand All @@ -43,7 +53,38 @@ jobs:
}
CONFIG
PUBLIC_URL=/mailinabox-ui/ npm run build
- name: Publish
- name: Create dist archives
id: archives
run: |
tag=${GITHUB_REF#refs/tags/}
tar_archive="$GITHUB_REPO.$tag.tar.gz"
zip_archive="$GITHUB_REPO.$tag.zip"
tar -czvf "$tar_archive" dist/
zip -r9 "$zip_archive" dist/
echo "::set-output name=tar_archive::$tar_archive"
echo "::set-output name=zip_archive::$zip_archive"
- name: Get release
id: get_release
uses: bruceadams/get-release@v1
- name: Upload release tar archive
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ${{ steps.archives.outputs.tar_archive }}
asset_name: ${{ steps.archives.outputs.tar_archive }}
asset_content_type: application/tar+gzip
- name: Upload release zip archive
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ${{ steps.archives.outputs.zip_archive }}
asset_name: ${{ steps.archives.outputs.zip_archive }}
asset_content_type: application/zip
- name: Publish demo
run: |
mv build .build
tag=${GITHUB_REF#refs/tags/}
Expand Down
5 changes: 3 additions & 2 deletions src/components/ui/LoginForm/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { useDispatch, useSelector } from 'react-redux';
import { useHistory } from 'react-router-dom';
import { userApi } from '../../../api';
import { useRequest } from '../../../api/useRequest';
import { config } from '../../../config';
import { updateAuth } from '../../../features/authSlice';
import { useFormInputs } from '../../../forms/useFormInputs';
import { RootState } from '../../../store';
Expand All @@ -29,8 +30,8 @@ type FormState = {
};

const initialFormState: FormState = {
email: '',
password: '',
email: config.mockApi ? 'demo@example.com' : '',
password: config.mockApi ? 'password' : '',
remember: true,
};

Expand Down

0 comments on commit 75ab487

Please sign in to comment.